about summary refs log tree commit diff
path: root/src/conf
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-08-28 21:22:48 -0400
committerRich Felker <dalias@aerifal.cx>2018-08-28 21:28:23 -0400
commitd41cdef9198e635270d30e82be939d4ea0cbce82 (patch)
treef77048ef77925b23e6d7b191bfaee1f58b21d2cc /src/conf
parent1d297a2821f8c5c5bc13b0bad88c966603ef46dc (diff)
downloadmusl-d41cdef9198e635270d30e82be939d4ea0cbce82.tar.gz
musl-d41cdef9198e635270d30e82be939d4ea0cbce82.tar.xz
musl-d41cdef9198e635270d30e82be939d4ea0cbce82.zip
fix several values reported by sysconf
- REALTIME_SIGNALS is supposed to be version-valued
- DELAYTIMER_MAX was wrongly using the min allowed max
- unavailable compilation environments wrongly used 0 instead of -1
Diffstat (limited to 'src/conf')
-rw-r--r--src/conf/sysconf.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c
index 9ce330a5..45ef1c16 100644
--- a/src/conf/sysconf.c
+++ b/src/conf/sysconf.c
@@ -18,6 +18,7 @@
 #define JT_PHYS_PAGES JT(8)
 #define JT_AVPHYS_PAGES JT(9)
 #define JT_ZERO JT(10)
+#define JT_DELAYTIMER_MAX JT(11)
 
 #define RLIM(x) (-32768|(RLIMIT_ ## x))
 
@@ -33,7 +34,7 @@ long sysconf(int name)
 		[_SC_TZNAME_MAX] = TZNAME_MAX,
 		[_SC_JOB_CONTROL] = 1,
 		[_SC_SAVED_IDS] = 1,
-		[_SC_REALTIME_SIGNALS] = 1,
+		[_SC_REALTIME_SIGNALS] = VER,
 		[_SC_PRIORITY_SCHEDULING] = -1,
 		[_SC_TIMERS] = VER,
 		[_SC_ASYNCHRONOUS_IO] = VER,
@@ -50,7 +51,7 @@ long sysconf(int name)
 		[_SC_AIO_LISTIO_MAX] = -1,
 		[_SC_AIO_MAX] = -1,
 		[_SC_AIO_PRIO_DELTA_MAX] = JT_ZERO, /* ?? */
-		[_SC_DELAYTIMER_MAX] = _POSIX_DELAYTIMER_MAX,
+		[_SC_DELAYTIMER_MAX] = JT_DELAYTIMER_MAX,
 		[_SC_MQ_OPEN_MAX] = -1,
 		[_SC_MQ_PRIO_MAX] = JT_MQ_PRIO_MAX,
 		[_SC_VERSION] = VER,
@@ -111,8 +112,8 @@ long sysconf(int name)
 		[_SC_XOPEN_XPG4] = -1,
 		[_SC_NZERO] = NZERO,
 		[_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,
+		[_SC_XBS5_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
+		[_SC_XBS5_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
 		[_SC_XBS5_LPBIG_OFFBIG] = -1,
 		[_SC_XOPEN_LEGACY] = -1,
 		[_SC_XOPEN_REALTIME] = -1,
@@ -141,8 +142,8 @@ long sysconf(int name)
 		[_SC_STREAMS] = JT_ZERO,
 		[_SC_2_PBS_CHECKPOINT] = -1,
 		[_SC_V6_ILP32_OFF32] = -1,
-		[_SC_V6_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO,
-		[_SC_V6_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO,
+		[_SC_V6_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
+		[_SC_V6_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
 		[_SC_V6_LPBIG_OFFBIG] = -1,
 		[_SC_HOST_NAME_MAX] = HOST_NAME_MAX,
 		[_SC_TRACE] = -1,
@@ -153,8 +154,8 @@ long sysconf(int name)
 		[_SC_IPV6] = VER,
 		[_SC_RAW_SOCKETS] = VER,
 		[_SC_V7_ILP32_OFF32] = -1,
-		[_SC_V7_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO,
-		[_SC_V7_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO,
+		[_SC_V7_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
+		[_SC_V7_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
 		[_SC_V7_LPBIG_OFFBIG] = -1,
 		[_SC_SS_REPL_MAX] = -1,
 		[_SC_TRACE_EVENT_NAME_MAX] = -1,
@@ -190,6 +191,8 @@ long sysconf(int name)
 		return PAGE_SIZE;
 	case JT_SEM_VALUE_MAX & 255:
 		return SEM_VALUE_MAX;
+	case JT_DELAYTIMER_MAX & 255:
+		return DELAYTIMER_MAX;
 	case JT_NPROCESSORS_CONF & 255:
 	case JT_NPROCESSORS_ONLN & 255: ;
 		unsigned char set[128] = {1};