summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-02 06:10:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-02 06:10:34 +0000
commitdd9569aa454092b1ba4e3aec3674f2c8ff71495c (patch)
tree4db0130f333a3d280cdc1f299342398d4d03939d /sys
parent3e2b3206473d422f933e48545bb8183a05d60949 (diff)
add sysctl and sysconf support for sysvsem, sysvshm, sysvmsg, and fsync; mostly from kleink
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sysctl.c22
-rw-r--r--sys/sys/sysctl.h12
-rw-r--r--sys/sys/unistd.h8
3 files changed, 38 insertions, 4 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 241fe031c66..c0d0316cfa7 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.24 1997/12/08 21:25:37 deraadt Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.25 1998/06/02 06:10:28 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -307,6 +307,26 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
sizeof(rndstats)));
case KERN_NOSUIDCOREDUMP:
return (sysctl_int(oldp, oldlenp, newp, newlen, &nosuidcoredump));
+ case KERN_FSYNC:
+ return (sysctl_rdint(oldp, oldlenp, newp, 1));
+ case KERN_SYSVMSG:
+#ifdef SYSVMSG
+ return (sysctl_rdint(oldp, oldlenp, newp, 1));
+#else
+ return (sysctl_rdint(oldp, oldlenp, newp, 0));
+#endif
+ case KERN_SYSVSEM:
+#ifdef SYSVSEM
+ return (sysctl_rdint(oldp, oldlenp, newp, 1));
+#else
+ return (sysctl_rdint(oldp, oldlenp, newp, 0));
+#endif
+ case KERN_SYSVSHM:
+#ifdef SYSVSHM
+ return (sysctl_rdint(oldp, oldlenp, newp, 1));
+#else
+ return (sysctl_rdint(oldp, oldlenp, newp, 0));
+#endif
default:
return (EOPNOTSUPP);
}
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 13aeb2fcb94..4b47e752a8c 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.24 1998/03/15 17:20:34 millert Exp $ */
+/* $OpenBSD: sysctl.h,v 1.25 1998/06/02 06:10:30 deraadt Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -146,7 +146,11 @@ struct ctlname {
#define KERN_USERMOUNT 30 /* int: users may mount filesystems */
#define KERN_RND 31 /* struct: rnd(4) statistics */
#define KERN_NOSUIDCOREDUMP 32 /* int: no setuid coredumps ever */
-#define KERN_MAXID 33 /* number of valid kern ids */
+#define KERN_FSYNC 33 /* int: file synchronization support */
+#define KERN_SYSVMSG 34 /* int: SysV message queue suppoprt */
+#define KERN_SYSVSEM 35 /* int: SysV semaphore support */
+#define KERN_SYSVSHM 36 /* int: SysV shared memory support */
+#define KERN_MAXID 37 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
@@ -182,6 +186,10 @@ struct ctlname {
{ "usermount", CTLTYPE_INT }, \
{ "random", CTLTYPE_STRUCT }, \
{ "nosuidcoredump", CTLTYPE_INT }, \
+ { "fsync", CTLTYPE_INT }, \
+ { "sysvmsg", CTLTYPE_INT }, \
+ { "sysvsem", CTLTYPE_INT }, \
+ { "sysvshm", CTLTYPE_INT }, \
}
/*
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index d0d760e61e2..72ab54ff00d 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.5 1996/10/26 06:54:43 tholo Exp $ */
+/* $OpenBSD: unistd.h,v 1.6 1998/06/02 06:10:31 deraadt Exp $ */
/* $NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $ */
/*
@@ -54,6 +54,8 @@
#define _POSIX_NO_TRUNC 1
/* may disable terminal special characters */
#define _POSIX_VDISABLE (0377)
+ /* file syncronization is available */
+#define _POSIX_FSYNC 1
/* access function */
#define F_OK 0 /* test for existence of file */
@@ -112,6 +114,10 @@
#define _SC_2_UPE 25
#define _SC_STREAM_MAX 26
#define _SC_TZNAME_MAX 27
+#define _SC_PAGESIZE 28
+#define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */
+#define _SC_FSYNC 29
+#define _SC_XOPEN_SHM 30
/* configurable system strings */
#define _CS_PATH 1