summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-12-17 23:11:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-12-17 23:11:33 +0000
commit25ea8c8a69576ca14e0d418bcc7d03b82db24db2 (patch)
treed9af0722d8761b2c04ddf3def6874033dfd44219 /lib/libc
parenta6dcb6be4019c0f02edd62f13fbb5737a42598aa (diff)
Make SysV-style shared memory and semaphore limits sysctl'able.
Instead of allocating a static amount of memory for the data structures via valloc() in allocsys(), allocate things dynamically using pool(9) when possible and malloc(9) when not. The various members of struct seminfo and struct shminfo are in kern.seminfo and kern.shminfo respectively (not all members of kern.seminfo are changable). The data structures used still leave something to be desired but things are not made worse in that respect by this commit.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysctl.388
1 files changed, 87 insertions, 1 deletions
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index 5ba3f08b7b9..de1053d42aa 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.3,v 1.95 2002/11/25 03:04:48 wcobb Exp $
+.\" $OpenBSD: sysctl.3,v 1.96 2002/12/17 23:11:32 millert Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -304,6 +304,8 @@ information.
.It Dv KERN_RND No " struct rndstats no"
.It Dv KERN_SAVED_IDS No " integer no"
.It Dv KERN_SECURELVL No " integer raise only"
+.It Dv KERN_SEMINFO No " node not applicable"
+.It Dv KERN_SHMINFO No " node not applicable"
.It Dv KERN_SOMINCONN No " integer yes"
.It Dv KERN_SOMAXCONN No " integer yes"
.It Dv KERN_SYSVIPC_INFO No " node not applicable"
@@ -535,6 +537,90 @@ Returns 1 if saved set-group-ID and saved set-user-ID are available.
The system security level.
This level may be raised by processes with appropriate privileges.
It may only be lowered by process 1.
+.It Dv KERN_SEMINFO
+Return the elements of
+.Li struct seminfo .
+If the kernel is not compiled with System V style semaphore support,
+attempts to retrieve any of the
+.Dv KERN_SEMINFO
+values will fail with
+.Er EOPNOTSUPP .
+The third level names for the elements of
+.Li struct seminfo
+are detailed below.
+The changeable column shows whether a process with appropriate
+privileges may change the value.
+.Bl -column "KERN_SEMINFO_SEMMNI" "integer" "yes" -offset indent
+.It Sy "Third level name" Type Changeable
+.It Dv KERN_SEMINFO_SEMMNI integer yes
+.It Dv KERN_SEMINFO_SEMMNS integer yes
+.It Dv KERN_SEMINFO_SEMMNU integer yes
+.It Dv KERN_SEMINFO_SEMMSL integer yes
+.It Dv KERN_SEMINFO_SEMOPM integer yes
+.It Dv KERN_SEMINFO_SEMUME integer no
+.It Dv KERN_SEMINFO_SEMUSZ integer no
+.It Dv KERN_SEMINFO_SEMVMX integer no
+.It Dv KERN_SEMINFO_SEMAEM integer no
+.El
+.Pp
+The variables are as follows:
+.Bl -tag -width "123456"
+.It Dv KERN_SEMINFO_SEMMNI
+The maximum number of semaphore identifiers allowed.
+.It Dv KERN_SEMINFO_SEMMNS
+The maximum number of semaphores allowed in the system.
+.It Dv KERN_SEMINFO_SEMMNU
+The maximum number of semaphore undo structures allowed in the system.
+.It Dv KERN_SEMINFO_SEMMSL
+The maximum number of semaphores allowed per id.
+.It Dv KERN_SEMINFO_SEMOPM
+The maximum number of operations per
+.Xr semop 2
+call.
+.It Dv KERN_SEMINFO_SEMUME
+The maximum number of undo entries per process.
+.It Dv KERN_SEMINFO_SEMUSZ
+The size (in bytes) of the undo structure.
+.It Dv KERN_SEMINFO_SEMVMX
+The semaphore maximum value.
+.It Dv KERN_SEMINFO_SEMAEM
+The adjust on exit maximum value.
+.El
+.It Dv KERN_SHMINFO
+Return the elements of
+.Li struct shminfo .
+If the kernel is not compiled with System V style shared memory support,
+attempts to retrieve any of the
+.Dv KERN_SHMINFO
+values will fail with
+.Er EOPNOTSUPP .
+The third level names for the elements of
+.Li struct shminfo
+are detailed below.
+The changeable column shows whether a process with appropriate
+privileges may change the value.
+.Bl -column "KERN_SHMINFO_SHMMAX" "integer" "yes" -offset indent
+.It Sy "Third level name" Type Changeable
+.It Dv KERN_SHMINFO_SHMMAX integer yes
+.It Dv KERN_SHMINFO_SHMMIN integer yes
+.It Dv KERN_SHMINFO_SHMMNI integer yes
+.It Dv KERN_SHMINFO_SHMSEG integer yes
+.It Dv KERN_SHMINFO_SHMALL integer yes
+.El
+.Pp
+The variables are as follows:
+.Bl -tag -width "123456"
+.It Dv KERN_SHMINFO_SHMMAX
+The maximum shared memory segment size (in bytes).
+.It Dv KERN_SHMINFO_SHMMIN
+The minimum shared memory segment size (in bytes).
+.It Dv KERN_SHMINFO_SHMMNI
+The maximum number of shared memory identifiers in the system.
+.It Dv KERN_SHMINFO_SHMSEG
+The maximum number of shared memory segments per process.
+.It Dv KERN_SHMINFO_SHMALL
+The maximum amount of total shared memory allowed in the system (in pages).
+.El
.It Dv KERN_SOMAXCONN
Upper bound on the number of half-open connections a process can allow
to be associated with a socket, using