From 369fe04016ea7a31008c50b210b53d2d70e1def0 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 16 Jul 2014 08:52:44 +0000 Subject: MFC r268467: Implement sysconf(_SC_GETGR_R_SIZE_MAX) and sysconf(_SC_GETPW_R_SIZE_MAX). --- lib/libc/gen/sysconf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index b7952b1..2b3acfb 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -367,11 +367,17 @@ yesno: * _POSIX_FILE_LOCKING, so we can't answer this one. */ #endif -#if _POSIX_THREAD_SAFE_FUNCTIONS > -1 + + /* + * SUSv4tc1 says the following about _SC_GETGR_R_SIZE_MAX and + * _SC_GETPW_R_SIZE_MAX: + * Note that sysconf(_SC_GETGR_R_SIZE_MAX) may return -1 if + * there is no hard limit on the size of the buffer needed to + * store all the groups returned. + */ case _SC_GETGR_R_SIZE_MAX: case _SC_GETPW_R_SIZE_MAX: -#error "somebody needs to implement this" -#endif + return (-1); case _SC_HOST_NAME_MAX: return (MAXHOSTNAMELEN - 1); /* does not include \0 */ case _SC_LOGIN_NAME_MAX: -- cgit v1.1