mqueues: Add support for _SC_MQ_PRIO_MAX in sysconf(3).
authorStathis Kamperis <beket@dragonflybsd.org>
Thu, 5 Nov 2009 14:19:59 +0000 (16:19 +0200)
committerStathis Kamperis <beket@dragonflybsd.org>
Thu, 5 Nov 2009 18:07:25 +0000 (20:07 +0200)
lib/libc/gen/sysconf.c

index 244aed9..aa73f45 100644 (file)
@@ -381,10 +381,13 @@ yesno:
 #else
                return (_POSIX_MONOTONIC_CLOCK);
 #endif
-#if _POSIX_MESSAGE_PASSING > -1
        case _SC_MQ_PRIO_MAX:
-               return (MQ_PRIO_MAX);
-#endif
+               len = sizeof(lvalue);
+               if (sysctlbyname("kern.mqueue.mq_prio_max", &lvalue, &len,
+                       NULL, 0) == -1)
+                       return (-1);
+               return (lvalue);
+
        case _SC_READER_WRITER_LOCKS:
                return (_POSIX_READER_WRITER_LOCKS);
        case _SC_REGEXP: