From 93be56ba88e1e31f4ba9f16a00b28cc9d15634ca Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 19 May 2014 12:18:16 -0400 Subject: remove unsupported nonstandard sysconf macros and their table entries some of these may have been from ancient (pre-SUSv2) POSIX versions; more likely, they were from POSIX drafts or glibc interpretations of what ancient versions of POSIX should have added (instead they made they described functionality mandatory and/or dropped it completely). others are purely glibc-isms, many of them ill-thought-out, like providing ways to lookup the min/max values of types at runtime (despite the impossibility of them changing at runtime and the impossibility of representing ULONG_MAX in a return value of type long). since our sysconf implementation does not support or return meaningful values for any of these, it's harmful to have the macros around; applications' build scripts may detect and attempt to use them, only to get -1/EINVAL as a result. if removing them does break some applications, and it's determined that the usage was reasonable, some of these could be added back on an as-needed basis, but they should return actual meaningful values, not junk like they were returning before. --- include/unistd.h | 60 ------------------------------------------------------ src/conf/sysconf.c | 60 ------------------------------------------------------ 2 files changed, 120 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index a906552d..bb19cd89 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -319,11 +319,9 @@ int eaccess(const char *, int); #define _SC_BC_SCALE_MAX 38 #define _SC_BC_STRING_MAX 39 #define _SC_COLL_WEIGHTS_MAX 40 -#define _SC_EQUIV_CLASS_MAX 41 #define _SC_EXPR_NEST_MAX 42 #define _SC_LINE_MAX 43 #define _SC_RE_DUP_MAX 44 -#define _SC_CHARCLASS_NAME_MAX 45 #define _SC_2_VERSION 46 #define _SC_2_C_BIND 47 #define _SC_2_C_DEV 48 @@ -331,21 +329,8 @@ int eaccess(const char *, int); #define _SC_2_FORT_RUN 50 #define _SC_2_SW_DEV 51 #define _SC_2_LOCALEDEF 52 -#define _SC_PII 53 -#define _SC_PII_XTI 54 -#define _SC_PII_SOCKET 55 -#define _SC_PII_INTERNET 56 -#define _SC_PII_OSI 57 -#define _SC_POLL 58 -#define _SC_SELECT 59 #define _SC_UIO_MAXIOV 60 /* !! */ #define _SC_IOV_MAX 60 -#define _SC_PII_INTERNET_STREAM 61 -#define _SC_PII_INTERNET_DGRAM 62 -#define _SC_PII_OSI_COTS 63 -#define _SC_PII_OSI_CLTS 64 -#define _SC_PII_OSI_M 65 -#define _SC_T_IOV_MAX 66 #define _SC_THREADS 67 #define _SC_THREAD_SAFE_FUNCTIONS 68 #define _SC_GETGR_R_SIZE_MAX 69 @@ -375,35 +360,11 @@ int eaccess(const char *, int); #define _SC_XOPEN_ENH_I18N 93 #define _SC_XOPEN_SHM 94 #define _SC_2_CHAR_TERM 95 -#define _SC_2_C_VERSION 96 #define _SC_2_UPE 97 #define _SC_XOPEN_XPG2 98 #define _SC_XOPEN_XPG3 99 #define _SC_XOPEN_XPG4 100 -#define _SC_CHAR_BIT 101 -#define _SC_CHAR_MAX 102 -#define _SC_CHAR_MIN 103 -#define _SC_INT_MAX 104 -#define _SC_INT_MIN 105 -#define _SC_LONG_BIT 106 -#define _SC_WORD_BIT 107 -#define _SC_MB_LEN_MAX 108 #define _SC_NZERO 109 -#define _SC_SSIZE_MAX 110 -#define _SC_SCHAR_MAX 111 -#define _SC_SCHAR_MIN 112 -#define _SC_SHRT_MAX 113 -#define _SC_SHRT_MIN 114 -#define _SC_UCHAR_MAX 115 -#define _SC_UINT_MAX 116 -#define _SC_ULONG_MAX 117 -#define _SC_USHRT_MAX 118 -#define _SC_NL_ARGMAX 119 -#define _SC_NL_LANGMAX 120 -#define _SC_NL_MSGMAX 121 -#define _SC_NL_NMAX 122 -#define _SC_NL_SETMAX 123 -#define _SC_NL_TEXTMAX 124 #define _SC_XBS5_ILP32_OFF32 125 #define _SC_XBS5_ILP32_OFFBIG 126 #define _SC_XBS5_LP64_OFF64 127 @@ -413,40 +374,19 @@ int eaccess(const char *, int); #define _SC_XOPEN_REALTIME_THREADS 131 #define _SC_ADVISORY_INFO 132 #define _SC_BARRIERS 133 -#define _SC_BASE 134 -#define _SC_C_LANG_SUPPORT 135 -#define _SC_C_LANG_SUPPORT_R 136 #define _SC_CLOCK_SELECTION 137 #define _SC_CPUTIME 138 #define _SC_THREAD_CPUTIME 139 -#define _SC_DEVICE_IO 140 -#define _SC_DEVICE_SPECIFIC 141 -#define _SC_DEVICE_SPECIFIC_R 142 -#define _SC_FD_MGMT 143 -#define _SC_FIFO 144 -#define _SC_PIPE 145 -#define _SC_FILE_ATTRIBUTES 146 -#define _SC_FILE_LOCKING 147 -#define _SC_FILE_SYSTEM 148 #define _SC_MONOTONIC_CLOCK 149 -#define _SC_MULTI_PROCESS 150 -#define _SC_SINGLE_PROCESS 151 -#define _SC_NETWORKING 152 #define _SC_READER_WRITER_LOCKS 153 #define _SC_SPIN_LOCKS 154 #define _SC_REGEXP 155 -#define _SC_REGEX_VERSION 156 #define _SC_SHELL 157 -#define _SC_SIGNALS 158 #define _SC_SPAWN 159 #define _SC_SPORADIC_SERVER 160 #define _SC_THREAD_SPORADIC_SERVER 161 -#define _SC_SYSTEM_DATABASE 162 -#define _SC_SYSTEM_DATABASE_R 163 #define _SC_TIMEOUTS 164 #define _SC_TYPED_MEMORY_OBJECTS 165 -#define _SC_USER_GROUPS 166 -#define _SC_USER_GROUPS_R 167 #define _SC_2_PBS 168 #define _SC_2_PBS_ACCOUNTING 169 #define _SC_2_PBS_LOCATE 170 diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c index 136bc1d9..b8b761d0 100644 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c @@ -65,11 +65,9 @@ long sysconf(int name) [_SC_BC_SCALE_MAX] = _POSIX2_BC_SCALE_MAX, [_SC_BC_STRING_MAX] = _POSIX2_BC_STRING_MAX, [_SC_COLL_WEIGHTS_MAX] = COLL_WEIGHTS_MAX, - [_SC_EQUIV_CLASS_MAX] = -1, /* ?? */ [_SC_EXPR_NEST_MAX] = -1, [_SC_LINE_MAX] = -1, [_SC_RE_DUP_MAX] = RE_DUP_MAX, - [_SC_CHARCLASS_NAME_MAX] = -1, /* ?? */ [_SC_2_VERSION] = VER, [_SC_2_C_BIND] = VER, [_SC_2_C_DEV] = -1, @@ -77,20 +75,7 @@ long sysconf(int name) [_SC_2_FORT_RUN] = -1, [_SC_2_SW_DEV] = -1, [_SC_2_LOCALEDEF] = -1, - [_SC_PII] = -1, /* ????????? */ - [_SC_PII_XTI] = -1, - [_SC_PII_SOCKET] = -1, - [_SC_PII_INTERNET] = -1, - [_SC_PII_OSI] = -1, - [_SC_POLL] = 1, - [_SC_SELECT] = 1, [_SC_IOV_MAX] = IOV_MAX, - [_SC_PII_INTERNET_STREAM] = -1, - [_SC_PII_INTERNET_DGRAM] = -1, - [_SC_PII_OSI_COTS] = -1, - [_SC_PII_OSI_CLTS] = -1, - [_SC_PII_OSI_M] = -1, - [_SC_T_IOV_MAX] = -1, [_SC_THREADS] = VER, [_SC_THREAD_SAFE_FUNCTIONS] = VER, [_SC_GETGR_R_SIZE_MAX] = -1, @@ -120,35 +105,11 @@ long sysconf(int name) [_SC_XOPEN_ENH_I18N] = 1, [_SC_XOPEN_SHM] = 1, [_SC_2_CHAR_TERM] = -1, - [_SC_2_C_VERSION] = -1, [_SC_2_UPE] = -1, [_SC_XOPEN_XPG2] = -1, [_SC_XOPEN_XPG3] = -1, [_SC_XOPEN_XPG4] = -1, - [_SC_CHAR_BIT] = -1, - [_SC_CHAR_MAX] = -1, - [_SC_CHAR_MIN] = -1, - [_SC_INT_MAX] = -1, - [_SC_INT_MIN] = -1, - [_SC_LONG_BIT] = -1, - [_SC_WORD_BIT] = -1, - [_SC_MB_LEN_MAX] = -1, [_SC_NZERO] = NZERO, - [_SC_SSIZE_MAX] = -1, - [_SC_SCHAR_MAX] = -1, - [_SC_SCHAR_MIN] = -1, - [_SC_SHRT_MAX] = -1, - [_SC_SHRT_MIN] = -1, - [_SC_UCHAR_MAX] = -1, - [_SC_UINT_MAX] = -1, - [_SC_ULONG_MAX] = -1, - [_SC_USHRT_MAX] = -1, - [_SC_NL_ARGMAX] = -1, - [_SC_NL_LANGMAX] = -1, - [_SC_NL_MSGMAX] = -1, - [_SC_NL_NMAX] = -1, - [_SC_NL_SETMAX] = -1, - [_SC_NL_TEXTMAX] = -1, [_SC_XBS5_ILP32_OFF32] = -1, [_SC_XBS5_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO, [_SC_XBS5_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO, @@ -158,40 +119,19 @@ long sysconf(int name) [_SC_XOPEN_REALTIME_THREADS] = -1, [_SC_ADVISORY_INFO] = VER, [_SC_BARRIERS] = VER, - [_SC_BASE] = -1, - [_SC_C_LANG_SUPPORT] = -1, - [_SC_C_LANG_SUPPORT_R] = -1, [_SC_CLOCK_SELECTION] = VER, [_SC_CPUTIME] = VER, [_SC_THREAD_CPUTIME] = VER, - [_SC_DEVICE_IO] = -1, - [_SC_DEVICE_SPECIFIC] = -1, - [_SC_DEVICE_SPECIFIC_R] = -1, - [_SC_FD_MGMT] = -1, - [_SC_FIFO] = -1, - [_SC_PIPE] = -1, - [_SC_FILE_ATTRIBUTES] = -1, - [_SC_FILE_LOCKING] = -1, - [_SC_FILE_SYSTEM] = -1, [_SC_MONOTONIC_CLOCK] = VER, - [_SC_MULTI_PROCESS] = -1, - [_SC_SINGLE_PROCESS] = -1, - [_SC_NETWORKING] = -1, [_SC_READER_WRITER_LOCKS] = VER, [_SC_SPIN_LOCKS] = VER, [_SC_REGEXP] = 1, - [_SC_REGEX_VERSION] = -1, [_SC_SHELL] = 1, - [_SC_SIGNALS] = -1, [_SC_SPAWN] = VER, [_SC_SPORADIC_SERVER] = -1, [_SC_THREAD_SPORADIC_SERVER] = -1, - [_SC_SYSTEM_DATABASE] = -1, - [_SC_SYSTEM_DATABASE_R] = -1, [_SC_TIMEOUTS] = VER, [_SC_TYPED_MEMORY_OBJECTS] = -1, - [_SC_USER_GROUPS] = -1, - [_SC_USER_GROUPS_R] = -1, [_SC_2_PBS] = -1, [_SC_2_PBS_ACCOUNTING] = -1, [_SC_2_PBS_LOCATE] = -1, -- cgit v1.2.1