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
This commit is contained in:
parent
bf43319445
commit
f6ef11cc75
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user