diff options
author | wollman <wollman@FreeBSD.org> | 2002-10-27 18:03:02 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2002-10-27 18:03:02 +0000 |
commit | e5980f83e69c6c6ede89ecd02db5e84687921122 (patch) | |
tree | e95736d462f3c4120df9be7585b75484117f5c69 /lib | |
parent | bd4df2f8087a78c8f8c38b02716da5716834d893 (diff) | |
download | FreeBSD-src-e5980f83e69c6c6ede89ecd02db5e84687921122.zip FreeBSD-src-e5980f83e69c6c6ede89ecd02db5e84687921122.tar.gz |
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 <sys/syslimits.h> to <limits.h> 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 <sys/syslimits.h> which I
will downgrade in the next commit.)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/sysconf.c | 24 |
1 files changed, 23 insertions, 1 deletions
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 <sys/time.h> #include <sys/sysctl.h> #include <sys/resource.h> +#include <sys/socket.h> #include <errno.h> #include <limits.h> @@ -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: |