svn commit: r316739 - head/lib/libc/gen
Konstantin Belousov
kib at FreeBSD.org
Wed Apr 12 19:27:16 UTC 2017
Author: kib
Date: Wed Apr 12 19:27:14 2017
New Revision: 316739
URL: https://svnweb.freebsd.org/changeset/base/316739
Log:
Report _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX which show parameters
of the current usermode implementation of the POSIX semaphores.
For NSEMS_MAX, return -1 without changing errno, which indicates that
the variable has no limit. Before, sysconf(3) returned parameters
queried from the ksem(9) legacy implementation, which apparently has
low defaults for NSEMS_MAX.
Reported and tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Modified:
head/lib/libc/gen/sysconf.c
Modified: head/lib/libc/gen/sysconf.c
==============================================================================
--- head/lib/libc/gen/sysconf.c Wed Apr 12 19:23:41 2017 (r316738)
+++ head/lib/libc/gen/sysconf.c Wed Apr 12 19:27:14 2017 (r316739)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <limits.h>
#include <paths.h>
#include <pthread.h> /* we just need the limits */
+#include <semaphore.h>
#include <time.h>
#include <unistd.h>
#include "un-namespace.h"
@@ -299,13 +300,9 @@ do_NAME_MAX:
mib[1] = CTL_P1003_1B_RTSIG_MAX;
goto yesno;
case _SC_SEM_NSEMS_MAX:
- mib[0] = CTL_P1003_1B;
- mib[1] = CTL_P1003_1B_SEM_NSEMS_MAX;
- goto yesno;
+ return (-1);
case _SC_SEM_VALUE_MAX:
- mib[0] = CTL_P1003_1B;
- mib[1] = CTL_P1003_1B_SEM_VALUE_MAX;
- goto yesno;
+ return (SEM_VALUE_MAX);
case _SC_SIGQUEUE_MAX:
mib[0] = CTL_P1003_1B;
mib[1] = CTL_P1003_1B_SIGQUEUE_MAX;
More information about the svn-src-head
mailing list