diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-05-01 23:12:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-05-01 23:12:31 +0000 |
commit | de05b4dda5a61e28195582a1335b4af49b9a118e (patch) | |
tree | 7639a2fc7acd0787e10243368b186381efa62928 | |
parent | ca460fb750902967c5f49621cc46edcec1070155 (diff) |
sys_semconfig goes foom
-rw-r--r-- | sys/compat/bsdos/bsdos_syscall.h | 8 | ||||
-rw-r--r-- | sys/compat/bsdos/bsdos_syscallargs.h | 5 | ||||
-rw-r--r-- | sys/compat/bsdos/bsdos_syscalls.c | 6 | ||||
-rw-r--r-- | sys/compat/bsdos/bsdos_sysent.c | 8 | ||||
-rw-r--r-- | sys/compat/common/kern_ipc_10.c | 9 | ||||
-rw-r--r-- | sys/compat/freebsd/freebsd_syscall.h | 8 | ||||
-rw-r--r-- | sys/compat/freebsd/freebsd_syscallargs.h | 5 | ||||
-rw-r--r-- | sys/compat/freebsd/freebsd_syscalls.c | 6 | ||||
-rw-r--r-- | sys/compat/freebsd/freebsd_sysent.c | 8 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_syscall.h | 8 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_syscallargs.h | 5 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_syscalls.c | 6 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_sysent.c | 8 | ||||
-rw-r--r-- | sys/kern/init_sysent.c | 8 | ||||
-rw-r--r-- | sys/kern/syscalls.c | 6 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 172 | ||||
-rw-r--r-- | sys/sys/sem.h | 7 | ||||
-rw-r--r-- | sys/sys/syscall.h | 8 | ||||
-rw-r--r-- | sys/sys/syscallargs.h | 9 |
19 files changed, 56 insertions, 244 deletions
diff --git a/sys/compat/bsdos/bsdos_syscall.h b/sys/compat/bsdos/bsdos_syscall.h index 4551a09871e..17f6b1455e7 100644 --- a/sys/compat/bsdos/bsdos_syscall.h +++ b/sys/compat/bsdos/bsdos_syscall.h @@ -1,10 +1,10 @@ -/* $OpenBSD: bsdos_syscall.h,v 1.6 1999/11/13 22:13:43 millert Exp $ */ +/* $OpenBSD: bsdos_syscall.h,v 1.7 2000/05/01 23:12:28 deraadt Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.6 1999/11/13 22:13:00 millert Exp + * created from OpenBSD: syscalls.master,v 1.7 2000/05/01 23:10:58 deraadt Exp */ /* syscall: "syscall" ret: "int" args: */ @@ -538,9 +538,7 @@ /* syscall: "semop" ret: "int" args: "int" "struct sembuf *" "u_int" */ #define BSDOS_SYS_semop 222 -/* syscall: "semconfig" ret: "int" args: "int" */ -#define BSDOS_SYS_semconfig 223 - + /* 223 is obsolete sys_semconfig */ /* syscall: "msgctl" ret: "int" args: "int" "int" "struct msqid_ds *" */ #define BSDOS_SYS_msgctl 224 diff --git a/sys/compat/bsdos/bsdos_syscallargs.h b/sys/compat/bsdos/bsdos_syscallargs.h index 7e688142353..7cc0fd17f2d 100644 --- a/sys/compat/bsdos/bsdos_syscallargs.h +++ b/sys/compat/bsdos/bsdos_syscallargs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: bsdos_syscallargs.h,v 1.6 1999/11/13 22:13:43 millert Exp $ */ +/* $OpenBSD: bsdos_syscallargs.h,v 1.7 2000/05/01 23:12:28 deraadt Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.6 1999/11/13 22:13:00 millert Exp + * created from OpenBSD: syscalls.master,v 1.7 2000/05/01 23:10:58 deraadt Exp */ #define syscallarg(x) union { x datum; register_t pad; } @@ -212,7 +212,6 @@ int sys_undelete __P((struct proc *, void *, register_t *)); int sys___semctl __P((struct proc *, void *, register_t *)); int sys_semget __P((struct proc *, void *, register_t *)); int sys_semop __P((struct proc *, void *, register_t *)); -int sys_semconfig __P((struct proc *, void *, register_t *)); #else #endif #ifdef SYSVMSG diff --git a/sys/compat/bsdos/bsdos_syscalls.c b/sys/compat/bsdos/bsdos_syscalls.c index 61e72c76b61..35a1cbff549 100644 --- a/sys/compat/bsdos/bsdos_syscalls.c +++ b/sys/compat/bsdos/bsdos_syscalls.c @@ -1,10 +1,10 @@ -/* $OpenBSD: bsdos_syscalls.c,v 1.6 1999/11/13 22:13:43 millert Exp $ */ +/* $OpenBSD: bsdos_syscalls.c,v 1.7 2000/05/01 23:12:28 deraadt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.6 1999/11/13 22:13:00 millert Exp + * created from OpenBSD: syscalls.master,v 1.7 2000/05/01 23:10:58 deraadt Exp */ char *bsdos_syscallnames[] = { @@ -259,7 +259,7 @@ char *bsdos_syscallnames[] = { "__semctl", /* 220 = __semctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ - "semconfig", /* 223 = semconfig */ + "#223 (obsolete sys_semconfig)", /* 223 = obsolete sys_semconfig */ #else "#220 (unimplemented semctl)", /* 220 = unimplemented semctl */ "#221 (unimplemented semget)", /* 221 = unimplemented semget */ diff --git a/sys/compat/bsdos/bsdos_sysent.c b/sys/compat/bsdos/bsdos_sysent.c index c6b3bedca62..6dae19475f6 100644 --- a/sys/compat/bsdos/bsdos_sysent.c +++ b/sys/compat/bsdos/bsdos_sysent.c @@ -1,10 +1,10 @@ -/* $OpenBSD: bsdos_sysent.c,v 1.6 1999/11/13 22:13:43 millert Exp $ */ +/* $OpenBSD: bsdos_sysent.c,v 1.7 2000/05/01 23:12:28 deraadt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.6 1999/11/13 22:13:00 millert Exp + * created from OpenBSD: syscalls.master,v 1.7 2000/05/01 23:10:58 deraadt Exp */ #include <sys/param.h> @@ -500,8 +500,8 @@ struct sysent bsdos_sysent[] = { sys_semget }, /* 221 = semget */ { 3, s(struct sys_semop_args), sys_semop }, /* 222 = semop */ - { 1, s(struct sys_semconfig_args), - sys_semconfig }, /* 223 = semconfig */ + { 0, 0, + sys_nosys }, /* 223 = obsolete sys_semconfig */ #else { 0, 0, sys_nosys }, /* 220 = unimplemented semctl */ diff --git a/sys/compat/common/kern_ipc_10.c b/sys/compat/common/kern_ipc_10.c index 9c71ce9f599..fa545873729 100644 --- a/sys/compat/common/kern_ipc_10.c +++ b/sys/compat/common/kern_ipc_10.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ipc_10.c,v 1.3 1998/02/10 04:04:03 deraadt Exp $ */ +/* $OpenBSD: kern_ipc_10.c,v 1.4 2000/05/01 23:12:28 deraadt Exp $ */ /* $NetBSD: kern_ipc_10.c,v 1.4 1995/10/07 06:26:25 mycroft Exp $ */ /* @@ -76,9 +76,6 @@ compat_10_sys_semsys(p, v, retval) syscallarg(struct sembuf *) sops; syscallarg(u_int) nsops; } */ semop_args; - struct sys_semconfig_args /* { - syscallarg(int) flag; - } */ semconfig_args; switch (SCARG(uap, which)) { case 0: /* __semctl() */ @@ -100,10 +97,6 @@ compat_10_sys_semsys(p, v, retval) SCARG(&semop_args, nsops) = SCARG(uap, a4); return (sys_semop(p, &semop_args, retval)); - case 3: /* semconfig() */ - SCARG(&semconfig_args, flag) = SCARG(uap, a2); - return (sys_semconfig(p, &semconfig_args, retval)); - default: return (EINVAL); } diff --git a/sys/compat/freebsd/freebsd_syscall.h b/sys/compat/freebsd/freebsd_syscall.h index 0ac42c777c1..c8fb5900010 100644 --- a/sys/compat/freebsd/freebsd_syscall.h +++ b/sys/compat/freebsd/freebsd_syscall.h @@ -1,10 +1,10 @@ -/* $OpenBSD: freebsd_syscall.h,v 1.12 1999/10/27 07:33:42 niklas Exp $ */ +/* $OpenBSD: freebsd_syscall.h,v 1.13 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.12 1999/10/27 07:32:55 niklas Exp + * created from OpenBSD: syscalls.master,v 1.13 2000/05/01 23:10:58 deraadt Exp */ /* syscall: "syscall" ret: "int" args: */ @@ -568,9 +568,7 @@ /* syscall: "semop" ret: "int" args: "int" "struct sembuf *" "u_int" */ #define FREEBSD_SYS_semop 222 -/* syscall: "semconfig" ret: "int" args: "int" */ -#define FREEBSD_SYS_semconfig 223 - + /* 223 is obsolete sys_semconfig */ /* syscall: "msgctl" ret: "int" args: "int" "int" "struct msqid_ds *" */ #define FREEBSD_SYS_msgctl 224 diff --git a/sys/compat/freebsd/freebsd_syscallargs.h b/sys/compat/freebsd/freebsd_syscallargs.h index 1ee6117ae7f..307a3ebae47 100644 --- a/sys/compat/freebsd/freebsd_syscallargs.h +++ b/sys/compat/freebsd/freebsd_syscallargs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: freebsd_syscallargs.h,v 1.13 1999/10/27 07:33:43 niklas Exp $ */ +/* $OpenBSD: freebsd_syscallargs.h,v 1.14 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.12 1999/10/27 07:32:55 niklas Exp + * created from OpenBSD: syscalls.master,v 1.13 2000/05/01 23:10:58 deraadt Exp */ #define syscallarg(x) union { x datum; register_t pad; } @@ -438,7 +438,6 @@ int sys_poll __P((struct proc *, void *, register_t *)); int sys___semctl __P((struct proc *, void *, register_t *)); int sys_semget __P((struct proc *, void *, register_t *)); int sys_semop __P((struct proc *, void *, register_t *)); -int sys_semconfig __P((struct proc *, void *, register_t *)); #else #endif #ifdef SYSVMSG diff --git a/sys/compat/freebsd/freebsd_syscalls.c b/sys/compat/freebsd/freebsd_syscalls.c index 70c0f2110b7..756fbae4d69 100644 --- a/sys/compat/freebsd/freebsd_syscalls.c +++ b/sys/compat/freebsd/freebsd_syscalls.c @@ -1,10 +1,10 @@ -/* $OpenBSD: freebsd_syscalls.c,v 1.12 1999/10/27 07:33:43 niklas Exp $ */ +/* $OpenBSD: freebsd_syscalls.c,v 1.13 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.12 1999/10/27 07:32:55 niklas Exp + * created from OpenBSD: syscalls.master,v 1.13 2000/05/01 23:10:58 deraadt Exp */ char *freebsd_syscallnames[] = { @@ -271,7 +271,7 @@ char *freebsd_syscallnames[] = { "__semctl", /* 220 = __semctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ - "semconfig", /* 223 = semconfig */ + "#223 (obsolete sys_semconfig)", /* 223 = obsolete sys_semconfig */ #else "#220 (unimplemented sys___semctl)", /* 220 = unimplemented sys___semctl */ "#221 (unimplemented sys_semget)", /* 221 = unimplemented sys_semget */ diff --git a/sys/compat/freebsd/freebsd_sysent.c b/sys/compat/freebsd/freebsd_sysent.c index 287db8cb539..38d5f0c29b1 100644 --- a/sys/compat/freebsd/freebsd_sysent.c +++ b/sys/compat/freebsd/freebsd_sysent.c @@ -1,10 +1,10 @@ -/* $OpenBSD: freebsd_sysent.c,v 1.13 1999/10/27 07:33:43 niklas Exp $ */ +/* $OpenBSD: freebsd_sysent.c,v 1.14 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from OpenBSD: syscalls.master,v 1.12 1999/10/27 07:32:55 niklas Exp + * created from OpenBSD: syscalls.master,v 1.13 2000/05/01 23:10:58 deraadt Exp */ #include <sys/param.h> @@ -516,8 +516,8 @@ struct sysent freebsd_sysent[] = { sys_semget }, /* 221 = semget */ { 3, s(struct sys_semop_args), sys_semop }, /* 222 = semop */ - { 1, s(struct sys_semconfig_args), - sys_semconfig }, /* 223 = semconfig */ + { 0, 0, + sys_nosys }, /* 223 = obsolete sys_semconfig */ #else { 0, 0, sys_nosys }, /* 220 = unimplemented sys___semctl */ diff --git a/sys/compat/netbsd/netbsd_syscall.h b/sys/compat/netbsd/netbsd_syscall.h index cb4272413b2..2af3831be93 100644 --- a/sys/compat/netbsd/netbsd_syscall.h +++ b/sys/compat/netbsd/netbsd_syscall.h @@ -1,10 +1,10 @@ -/* $OpenBSD: netbsd_syscall.h,v 1.10 1999/09/21 22:46:09 kstailey Exp $ */ +/* $OpenBSD: netbsd_syscall.h,v 1.11 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.10 1999/09/21 22:45:07 kstailey Exp + * created from; OpenBSD: syscalls.master,v 1.11 2000/05/01 23:10:58 deraadt Exp */ /* syscall: "syscall" ret: "int" args: "int" "..." */ @@ -583,9 +583,7 @@ /* syscall: "semop" ret: "int" args: "int" "struct sembuf *" "u_int" */ #define NETBSD_SYS_semop 222 -/* syscall: "semconfig" ret: "int" args: "int" */ -#define NETBSD_SYS_semconfig 223 - + /* 223 is obsolete sys_semconfig */ /* syscall: "omsgctl" ret: "int" args: "int" "int" "struct omsqid_ds *" */ #define NETBSD_SYS_omsgctl 224 diff --git a/sys/compat/netbsd/netbsd_syscallargs.h b/sys/compat/netbsd/netbsd_syscallargs.h index 96b5e4a2d41..42f04f17416 100644 --- a/sys/compat/netbsd/netbsd_syscallargs.h +++ b/sys/compat/netbsd/netbsd_syscallargs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: netbsd_syscallargs.h,v 1.10 1999/09/21 22:46:09 kstailey Exp $ */ +/* $OpenBSD: netbsd_syscallargs.h,v 1.11 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.10 1999/09/21 22:45:07 kstailey Exp + * created from; OpenBSD: syscalls.master,v 1.11 2000/05/01 23:10:58 deraadt Exp */ #define syscallarg(x) union { x datum; register_t pad; } @@ -478,7 +478,6 @@ int sys_lkmnosys __P((struct proc *, void *, register_t *)); int sys___osemctl __P((struct proc *, void *, register_t *)); int sys_semget __P((struct proc *, void *, register_t *)); int sys_semop __P((struct proc *, void *, register_t *)); -int sys_semconfig __P((struct proc *, void *, register_t *)); #else #endif #ifdef SYSVMSG diff --git a/sys/compat/netbsd/netbsd_syscalls.c b/sys/compat/netbsd/netbsd_syscalls.c index 91da5a2d19a..9e6ce508cb8 100644 --- a/sys/compat/netbsd/netbsd_syscalls.c +++ b/sys/compat/netbsd/netbsd_syscalls.c @@ -1,10 +1,10 @@ -/* $OpenBSD: netbsd_syscalls.c,v 1.10 1999/09/21 22:46:09 kstailey Exp $ */ +/* $OpenBSD: netbsd_syscalls.c,v 1.11 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.10 1999/09/21 22:45:07 kstailey Exp + * created from; OpenBSD: syscalls.master,v 1.11 2000/05/01 23:10:58 deraadt Exp */ char *netbsd_syscallnames[] = { @@ -285,7 +285,7 @@ char *netbsd_syscallnames[] = { "__osemctl", /* 220 = __osemctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ - "semconfig", /* 223 = semconfig */ + "#223 (obsolete sys_semconfig)", /* 223 = obsolete sys_semconfig */ #else "#220 (unimplemented semctl)", /* 220 = unimplemented semctl */ "#221 (unimplemented semget)", /* 221 = unimplemented semget */ diff --git a/sys/compat/netbsd/netbsd_sysent.c b/sys/compat/netbsd/netbsd_sysent.c index 82de25d36e3..d90aec1d102 100644 --- a/sys/compat/netbsd/netbsd_sysent.c +++ b/sys/compat/netbsd/netbsd_sysent.c @@ -1,10 +1,10 @@ -/* $OpenBSD: netbsd_sysent.c,v 1.10 1999/09/21 22:46:09 kstailey Exp $ */ +/* $OpenBSD: netbsd_sysent.c,v 1.11 2000/05/01 23:12:29 deraadt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.10 1999/09/21 22:45:07 kstailey Exp + * created from; OpenBSD: syscalls.master,v 1.11 2000/05/01 23:10:58 deraadt Exp */ #include <sys/param.h> @@ -545,8 +545,8 @@ struct sysent netbsd_sysent[] = { sys_semget }, /* 221 = semget */ { 3, s(struct sys_semop_args), sys_semop }, /* 222 = semop */ - { 1, s(struct sys_semconfig_args), - sys_semconfig }, /* 223 = semconfig */ + { 0, 0, + sys_nosys }, /* 223 = obsolete sys_semconfig */ #else { 0, 0, sys_nosys }, /* 220 = unimplemented semctl */ diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index da329080a3a..3d843031bc5 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -1,10 +1,10 @@ -/* $OpenBSD: init_sysent.c,v 1.44 2000/04/20 06:32:47 deraadt Exp $ */ +/* $OpenBSD: init_sysent.c,v 1.45 2000/05/01 23:12:30 deraadt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.39 2000/04/20 06:32:23 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.40 2000/05/01 23:10:58 deraadt Exp */ #include <sys/param.h> @@ -553,8 +553,8 @@ struct sysent sysent[] = { sys_semget }, /* 221 = semget */ { 3, s(struct sys_semop_args), sys_semop }, /* 222 = semop */ - { 1, s(struct sys_semconfig_args), - sys_semconfig }, /* 223 = semconfig */ + { 0, 0, + sys_nosys }, /* 223 = obsolete sys_semconfig */ #else { 0, 0, sys_nosys }, /* 220 = unimplemented semctl */ diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index cbdc7cde0b8..26c6837fd9c 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -1,10 +1,10 @@ -/* $OpenBSD: syscalls.c,v 1.44 2000/04/20 06:32:47 deraadt Exp $ */ +/* $OpenBSD: syscalls.c,v 1.45 2000/05/01 23:12:30 deraadt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.39 2000/04/20 06:32:23 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.40 2000/05/01 23:10:58 deraadt Exp */ char *syscallnames[] = { @@ -281,7 +281,7 @@ char *syscallnames[] = { "__osemctl", /* 220 = __osemctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ - "semconfig", /* 223 = semconfig */ + "#223 (obsolete sys_semconfig)", /* 223 = obsolete sys_semconfig */ #else "#220 (unimplemented semctl)", /* 220 = unimplemented semctl */ "#221 (unimplemented semget)", /* 221 = unimplemented semget */ diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index f6c312bff35..08ee386ece7 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_sem.c,v 1.3 1998/06/11 18:32:16 deraadt Exp $ */ +/* $OpenBSD: sysv_sem.c,v 1.4 2000/05/01 23:12:30 deraadt Exp $ */ /* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */ /* @@ -20,9 +20,7 @@ #include <sys/syscallargs.h> int semtot = 0; -struct proc *semlock_holder = NULL; -void semlock __P((struct proc *)); struct sem_undo *semu_alloc __P((struct proc *)); int semundo_adjust __P((struct proc *, struct sem_undo **, int, int, int)); void semundo_clear __P((int, int)); @@ -48,65 +46,6 @@ seminit() semu_list = NULL; } -void -semlock(p) - struct proc *p; -{ - - while (semlock_holder != NULL && semlock_holder != p) - sleep((caddr_t)&semlock_holder, (PZERO - 4)); -} - -/* - * Lock or unlock the entire semaphore facility. - * - * This will probably eventually evolve into a general purpose semaphore - * facility status enquiry mechanism (I don't like the "read /dev/kmem" - * approach currently taken by ipcs and the amount of info that we want - * to be able to extract for ipcs is probably beyond the capability of - * the getkerninfo facility. - * - * At the time that the current version of semconfig was written, ipcs is - * the only user of the semconfig facility. It uses it to ensure that the - * semaphore facility data structures remain static while it fishes around - * in /dev/kmem. - */ - -int -sys_semconfig(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct sys_semconfig_args /* { - syscallarg(int) flag; - } */ *uap = v; - int eval = 0; - - semlock(p); - - switch (SCARG(uap, flag)) { - case SEM_CONFIG_FREEZE: - semlock_holder = p; - break; - - case SEM_CONFIG_THAW: - semlock_holder = NULL; - wakeup((caddr_t)&semlock_holder); - break; - - default: - printf( - "semconfig: unknown flag parameter value (%d) - ignored\n", - SCARG(uap, flag)); - eval = EINVAL; - break; - } - - *retval = 0; - return(eval); -} - /* * Allocate a new sem_undo structure for a process * (returns ptr to structure or NULL if no more room) @@ -318,8 +257,6 @@ sys___osemctl(p, v, retval) printf("call to semctl(%d, %d, %d, %p)\n", semid, semnum, cmd, arg); #endif - semlock(p); - semid = IPCID_TO_IX(semid); if (semid < 0 || semid >= seminfo.semmsl) return(EINVAL); @@ -483,8 +420,6 @@ sys___semctl(p, v, retval) printf("call to semctl(%d, %d, %d, %p)\n", semid, semnum, cmd, arg); #endif - semlock(p); - semid = IPCID_TO_IX(semid); if (semid < 0 || semid >= seminfo.semmsl) return(EINVAL); @@ -643,8 +578,6 @@ sys_semget(p, v, retval) printf("semget(0x%x, %d, 0%o)\n", key, nsems, semflg); #endif - semlock(p); - if (key != IPC_PRIVATE) { for (semid = 0; semid < seminfo.semmni; semid++) { if ((sema[semid].sem_perm.mode & SEM_ALLOC) && @@ -762,8 +695,6 @@ sys_semop(p, v, retval) printf("call to semop(%d, %p, %d)\n", semid, sops, nsops); #endif - semlock(p); - semid = IPCID_TO_IX(semid); /* Convert back to zero origin */ if (semid < 0 || semid >= seminfo.semmsl) @@ -1030,94 +961,13 @@ semexit(p) } /* - * There are a few possibilities to consider here ... - * - * 1) The semaphore facility isn't currently locked. In this case, - * this call should proceed normally. - * 2) The semaphore facility is locked by this process (i.e. the one - * that is exiting). In this case, this call should proceed as - * usual and the facility should be unlocked at the end of this - * routine (since the locker is exiting). - * 3) The semaphore facility is locked by some other process and this - * process doesn't have an undo structure allocated for it. In this - * case, this call should proceed normally (i.e. not accomplish - * anything and, most importantly, not block since that is - * unnecessary and could result in a LOT of processes blocking in - * here if the facility is locked for a long time). - * 4) The semaphore facility is locked by some other process and this - * process has an undo structure allocated for it. In this case, - * this call should block until the facility has been unlocked since - * the holder of the lock may be examining this process's proc entry - * (the ipcs utility does this when printing out the information - * from the allocated sem undo elements). + * No (i.e. we are in case 1 or 2). * - * This leads to the conclusion that we should not block unless we - * discover that the someone else has the semaphore facility locked and - * this process has an undo structure. Let's do that... - * - * Note that we do this in a separate pass from the one that processes - * any existing undo structure since we don't want to risk blocking at - * that time (it would make the actual unlinking of the element from - * the chain of allocated undo structures rather messy). - */ - - /* - * Does someone else hold the semaphore facility's lock? + * If there is no undo vector, skip to the end and unlock the + * semaphore facility if necessary. */ - - if (semlock_holder != NULL && semlock_holder != p) { - /* - * Yes (i.e. we are in case 3 or 4). - * - * If we didn't find an undo vector associated with this - * process than we can just return (i.e. we are in case 3). - * - * Note that we know that someone else is holding the lock so - * we don't even have to see if we're holding it... - */ - - if (suptr == NULL) - return; - - /* - * We are in case 4. - * - * Go to sleep as long as someone else is locking the semaphore - * facility (note that we won't get here if we are holding the - * lock so we don't need to check for that possibility). - */ - - while (semlock_holder != NULL) - sleep((caddr_t)&semlock_holder, (PZERO - 4)); - - /* - * Nobody is holding the facility (i.e. we are now in case 1). - * We can proceed safely according to the argument outlined - * above. - * - * We look up the undo vector again, in case the list changed - * while we were asleep, and the parent is now different. - */ - - for (supptr = &semu_list; (suptr = *supptr) != NULL; - supptr = &suptr->un_next) { - if (suptr->un_proc == p) - break; - } - - if (suptr == NULL) - panic("semexit: undo vector disappeared"); - } else { - /* - * No (i.e. we are in case 1 or 2). - * - * If there is no undo vector, skip to the end and unlock the - * semaphore facility if necessary. - */ - - if (suptr == NULL) - goto unlock; - } + if (suptr == NULL) + return; /* * We are now in case 1 or 2, and we have an undo vector for this @@ -1180,14 +1030,4 @@ semexit(p) #endif suptr->un_proc = NULL; *supptr = suptr->un_next; - -unlock: - /* - * If the exiting process is holding the global semaphore facility - * lock (i.e. we are in case 2) then release it. - */ - if (semlock_holder == p) { - semlock_holder = NULL; - wakeup((caddr_t)&semlock_holder); - } } diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 45d53039830..7b67bad27e8 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sem.h,v 1.7 1998/07/20 07:37:22 deraadt Exp $ */ +/* $OpenBSD: sem.h,v 1.8 2000/05/01 23:12:30 deraadt Exp $ */ /* $NetBSD: sem.h,v 1.8 1996/02/09 18:25:29 christos Exp $ */ /* @@ -173,11 +173,6 @@ int *semu; /* undo structure pool */ */ #define SEMU(ix) ((struct sem_undo *)(((long)semu)+ix * SEMUSZ)) -/* - * Parameters to the semconfig system call - */ -#define SEM_CONFIG_FREEZE 0 /* Freeze the semaphore facility. */ -#define SEM_CONFIG_THAW 1 /* Thaw the semaphore facility. */ #endif /* _KERNEL */ #ifndef _KERNEL diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 3810113a68d..93f43e25111 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -1,10 +1,10 @@ -/* $OpenBSD: syscall.h,v 1.43 2000/04/20 06:32:47 deraadt Exp $ */ +/* $OpenBSD: syscall.h,v 1.44 2000/05/01 23:12:30 deraadt Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.39 2000/04/20 06:32:23 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.40 2000/05/01 23:10:58 deraadt Exp */ /* syscall: "syscall" ret: "int" args: "int" "..." */ @@ -539,9 +539,7 @@ /* syscall: "semop" ret: "int" args: "int" "struct sembuf *" "u_int" */ #define SYS_semop 222 -/* syscall: "semconfig" ret: "int" args: "int" */ -#define SYS_semconfig 223 - + /* 223 is obsolete sys_semconfig */ /* syscall: "omsgctl" ret: "int" args: "int" "int" "struct omsqid_ds *" */ #define SYS_omsgctl 224 diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h index 6c29c41b9f5..93456d0f49b 100644 --- a/sys/sys/syscallargs.h +++ b/sys/sys/syscallargs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: syscallargs.h,v 1.44 2000/04/20 06:32:47 deraadt Exp $ */ +/* $OpenBSD: syscallargs.h,v 1.45 2000/05/01 23:12:30 deraadt Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.39 2000/04/20 06:32:23 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.40 2000/05/01 23:10:58 deraadt Exp */ #define syscallarg(x) union { x datum; register_t pad; } @@ -937,10 +937,6 @@ struct sys_semop_args { syscallarg(u_int) nsops; }; -struct sys_semconfig_args { - syscallarg(int) flag; -}; - struct sys_omsgctl_args { syscallarg(int) msqid; syscallarg(int) cmd; @@ -1339,7 +1335,6 @@ int sys_lkmnosys __P((struct proc *, void *, register_t *)); int sys___osemctl __P((struct proc *, void *, register_t *)); int sys_semget __P((struct proc *, void *, register_t *)); int sys_semop __P((struct proc *, void *, register_t *)); -int sys_semconfig __P((struct proc *, void *, register_t *)); #else #endif #ifdef SYSVMSG |