From e5980f83e69c6c6ede89ecd02db5e84687921122 Mon Sep 17 00:00:00 2001 From: wollman Date: Sun, 27 Oct 2002 18:03:02 +0000 Subject: Update limits and configuration parameters for 1003.1/TC1/D6. Implement new sysconf keys. Change the implenentation of _SC_ASYNCHRONOUS_IO in preparation for the next set of changes. Move some limits which had been in to where they belong. They had only ever been in syslimits.h to provide for the kernel implementation of the CTL_USER MIB branch, which went away with newsysctl years ago. (There is a #error in which I will downgrade in the next commit.) --- lib/libc/gen/sysconf.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index ee596a2..2f1dcca 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -176,9 +177,13 @@ do_NAME_MAX: return (value); case _SC_ASYNCHRONOUS_IO: +#if _POSIX_ASYNCHRONOUS_IO == 0 mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_ASYNCHRONOUS_IO; - goto yesno; + break; +#else + return (_POSIX_ASYNCHRONOUS_IO); +#endif case _SC_MAPPED_FILES: return (_POSIX_MAPPED_FILES); case _SC_MEMLOCK: @@ -545,6 +550,23 @@ yesno: if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) case _SC_XOPEN_XCU_VERSION: return (_XOPEN_XCU_VERSION); #endif + case _SC_SYMLOOP_MAX: + return (MAXSYMLINKS); + case _SC_RAW_SOCKETS: + return (_POSIX_RAW_SOCKETS); + case _SC_IPV6: +#if _POSIX_IPV6 == 0 + sverrno = errno; + value = socket(PF_INET6, SOCK_DGRAM, 0); + errno = sverrno; + if (value >= 0) { + close(value); + return (200112L); + } else + return (0); +#else + return (_POSIX_IPV6); +#endif case _SC_NPROCESSORS_CONF: case _SC_NPROCESSORS_ONLN: -- cgit v1.1