fix overflow in sysconf for _SC_MQ_PRIO_MAX
authorRich Felker <dalias@aerifal.cx>
Sat, 14 Sep 2013 23:27:24 +0000 (19:27 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 14 Sep 2013 23:27:24 +0000 (19:27 -0400)
the value of MQ_PRIO_MAX does not fit, so it needs to use OFLOW.

src/conf/sysconf.c

index d979b62691d70d7f5502f96e4fdcaf995b029ba8..5dc1e453aecf93d5815b0f3067374bc3a83cf296 100644 (file)
@@ -40,7 +40,7 @@ long sysconf(int name)
                [_SC_AIO_PRIO_DELTA_MAX] = 0, /* ?? */
                [_SC_DELAYTIMER_MAX] = _POSIX_DELAYTIMER_MAX,
                [_SC_MQ_OPEN_MAX] = -1,
-               [_SC_MQ_PRIO_MAX] = MQ_PRIO_MAX,
+               [_SC_MQ_PRIO_MAX] = OFLOW,
                [_SC_VERSION] = VER,
                [_SC_PAGE_SIZE] = PAGE_SIZE,
                [_SC_RTSIG_MAX] = 63, /* ?? */
@@ -221,6 +221,7 @@ long sysconf(int name)
        } else if (values[name] == OFLOW) {
                if (name == _SC_ARG_MAX) return ARG_MAX;
                if (name == _SC_SEM_VALUE_MAX) return SEM_VALUE_MAX;
+               if (name == _SC_MQ_PRIO_MAX) return MQ_PRIO_MAX;
        } else if (values[name] == CPUCNT) {
                unsigned char set[128] = {1};
                int i, cnt;