From 22384accd747d63eaee73c993a5b51dc71dd3be4 Mon Sep 17 00:00:00 2001 From: kleink Date: Mon, 3 Aug 1998 14:41:21 +0000 Subject: [PATCH] Add support for _SC_SYNCHRONIZED_IO and _SC_IOV_MAX. Rearrange documentation a bit, and actually document _SC_XOPEN_SHM. --- lib/libc/gen/sysconf.3 | 32 +++++++++++++++++++++++++------- lib/libc/gen/sysconf.c | 12 ++++++++++-- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/sysconf.3 b/lib/libc/gen/sysconf.3 index 8c48808b1a05..22032aeac704 100644 --- a/lib/libc/gen/sysconf.3 +++ b/lib/libc/gen/sysconf.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: sysconf.3,v 1.8 1998/05/24 20:12:25 kleink Exp $ +.\" $NetBSD: sysconf.3,v 1.9 1998/08/03 14:41:21 kleink Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -73,18 +73,37 @@ The maximum bytes of argument to The maximum number of simultaneous processes per user id. .It Li _SC_CLK_TCK The number of clock ticks per second. +.It Li _SC_FSYNC +Return 1 if the File Synchronization Option is available on this system, +otherwise \-1. +.It Li _SC_IOV_MAX +The maximum number of +.Va iovec +structures that a process has available for use with +.Xr preadv 2 , +.Xr pwritev 2 , +.Xr readv 2 , +.Xr recvmsg 2 , +.Xr sendmsg 2 +or +.Xr writev 2 . +.It Li _SC_JOB_CONTROL +Return 1 if job control is available on this system, otherwise \-1. .It Li _SC_NGROUPS_MAX The maximum number of supplemental groups. .It Li _SC_OPEN_MAX The maximum number of open files per user id. +.It Li _SC_PAGESIZE +The size of a system page in bytes. .It Li _SC_STREAM_MAX The minimum maximum number of streams that a process may have open at any one time. +.It Li _SC_SYNCHRONIZED_IO +Return 1 if the Synchronized I/O Option is available on this system, +otherwise \-1. .It Li _SC_TZNAME_MAX The minimum maximum number of types supported for the name of a timezone. -.It Li _SC_JOB_CONTROL -Return 1 if job control is available on this system, otherwise \-1. .It Li _SC_SAVED_IDS Returns 1 if saved set-group and saved set-user ID is available, otherwise \-1. @@ -146,10 +165,9 @@ otherwise \-1. .It Li _SC_2_UPE Return 1 if the system supports the User Portability Utilities Option, otherwise \-1. -.It Li _SC_PAGESIZE -The size of a system page in bytes. -.It Li _SC_FSYNC -Return 1 if the system supports the File Synchronisation Option, otherwise \-1. +.It Li _SC_XOPEN_SHM +Return 1 of the system supports System V style shared memory, +otherwise \-1. .El .Sh RETURN VALUES If the call to diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index 5d3a51a87cd3..0cea331bd66f 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysconf.c,v 1.8 1998/05/24 20:12:27 kleink Exp $ */ +/* $NetBSD: sysconf.c,v 1.9 1998/08/03 14:41:21 kleink Exp $ */ /*- * Copyright (c) 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94"; #else -__RCSID("$NetBSD: sysconf.c,v 1.8 1998/05/24 20:12:27 kleink Exp $"); +__RCSID("$NetBSD: sysconf.c,v 1.9 1998/08/03 14:41:21 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -127,6 +127,10 @@ sysconf(name) mib[0] = CTL_KERN; mib[1] = KERN_FSYNC; goto yesno; + case _SC_SYNCHRONIZED_IO: + mib[0] = CTL_KERN; + mib[1] = KERN_SYNCHRONIZED_IO; + goto yesno; /* 1003.2 */ case _SC_BC_BASE_MAX: @@ -199,6 +203,10 @@ sysconf(name) goto yesno; /* XPG 4.2 */ + case _SC_IOV_MAX: + mib[0] = CTL_KERN; + mib[1] = KERN_IOV_MAX; + break; case _SC_XOPEN_SHM: mib[0] = CTL_KERN; mib[1] = KERN_SYSVSHM;