aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2000-05-01 11:29:47 +0000
committerPeter Wemm <peter@FreeBSD.org>2000-05-01 11:29:47 +0000
commit8407332648bbc5b982c2379c42af35c61ec807e2 (patch)
tree379b2ccc3d311f58d4ef3d6ed58b7619aeda7733
parent2036e763d7af633ebc9d38866adee43ad9a058de (diff)
MFC: remove flawed semconfig(2)
Notes
Notes: svn path=/stable/2.2/; revision=59836
-rw-r--r--sys/kern/init_sysent.c5
-rw-r--r--sys/kern/syscalls.c5
-rw-r--r--sys/kern/sysv_ipc.c10
-rw-r--r--sys/kern/sysv_sem.c83
-rw-r--r--sys/sys/sem.h8
-rw-r--r--sys/sys/syscall-hide.h4
-rw-r--r--sys/sys/syscall.h4
-rw-r--r--sys/sys/sysproto.h7
8 files changed, 14 insertions, 112 deletions
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index ed1c4ca99729..89c966f8a2f6 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -2,7 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.29.2.3 1997/09/03 06:31:56 peter Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.29.2.5 2000/05/01 11:22:17 peter Exp
*/
#include <sys/types.h>
@@ -257,7 +258,7 @@ struct sysent sysent[] = {
{ 4, (sy_call_t *)__semctl }, /* 220 = __semctl */
{ 3, (sy_call_t *)semget }, /* 221 = semget */
{ 3, (sy_call_t *)semop }, /* 222 = semop */
- { 1, (sy_call_t *)semconfig }, /* 223 = semconfig */
+ { 0, (sy_call_t *)nosys }, /* 223 = semconfig */
{ 3, (sy_call_t *)msgctl }, /* 224 = msgctl */
{ 2, (sy_call_t *)msgget }, /* 225 = msgget */
{ 4, (sy_call_t *)msgsnd }, /* 226 = msgsnd */
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 54ad8d7ced5c..fbdb744a28cb 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -2,7 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.29.2.3 1997/09/03 06:31:56 peter Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.29.2.5 2000/05/01 11:22:17 peter Exp
*/
char *syscallnames[] = {
@@ -244,7 +245,7 @@ char *syscallnames[] = {
"__semctl", /* 220 = __semctl */
"semget", /* 221 = semget */
"semop", /* 222 = semop */
- "semconfig", /* 223 = semconfig */
+ "#223", /* 223 = semconfig */
"msgctl", /* 224 = msgctl */
"msgget", /* 225 = msgget */
"msgsnd", /* 226 = msgsnd */
diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c
index 35e9dc7d99ad..3ad61a07c395 100644
--- a/sys/kern/sysv_ipc.c
+++ b/sys/kern/sysv_ipc.c
@@ -109,16 +109,6 @@ semsys(p, uap, retval)
};
int
-semconfig(p, uap, retval)
- struct proc *p;
- struct semconfig_args *uap;
- int *retval;
-{
- sysv_nosys(p, "SYSVSEM");
- return nosys(p, (struct nosys_args *)uap, retval);
-};
-
-int
__semctl(p, uap, retval)
struct proc *p;
register struct __semctl_args *uap;
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 2ea7fcbee48d..33d6df12b988 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -28,9 +28,6 @@ struct semget_args;
int semget __P((struct proc *p, struct semget_args *uap, int *retval));
struct semop_args;
int semop __P((struct proc *p, struct semop_args *uap, int *retval));
-struct semconfig_args;
-int semconfig __P((struct proc *p, struct semconfig_args *uap,
- int *retval));
#endif
static struct sem_undo *semu_alloc __P((struct proc *p));
@@ -41,7 +38,7 @@ static void semundo_clear __P((int semid, int semnum));
/* XXX casting to (sy_call_t *) is bogus, as usual. */
static sy_call_t *semcalls[] = {
(sy_call_t *)__semctl, (sy_call_t *)semget,
- (sy_call_t *)semop, (sy_call_t *)semconfig
+ (sy_call_t *)semop
};
static int semtot = 0;
@@ -50,8 +47,6 @@ struct sem *sem; /* semaphore pool */
static struct sem_undo *semu_list; /* list of active undo structures */
int *semu; /* undo structure pool */
-static struct proc *semlock_holder = NULL;
-
void
seminit(dummy)
void *dummy;
@@ -91,65 +86,12 @@ semsys(p, uap, retval)
int *retval;
{
- while (semlock_holder != NULL && semlock_holder != p)
- (void) tsleep((caddr_t)&semlock_holder, (PZERO - 4), "semsys", 0);
-
if (uap->which >= sizeof(semcalls)/sizeof(semcalls[0]))
return (EINVAL);
return ((*semcalls[uap->which])(p, &uap->a2, retval));
}
/*
- * 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 what 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.
- */
-
-#ifndef _SYS_SYSPROTO_H_
-struct semconfig_args {
- semconfig_ctl_t flag;
-};
-#endif
-
-int
-semconfig(p, uap, retval)
- struct proc *p;
- struct semconfig_args *uap;
- int *retval;
-{
- int eval = 0;
-
- switch (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",
- 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)
*/
@@ -886,17 +828,6 @@ semexit(p)
register struct sem_undo **supptr;
int did_something;
- /*
- * If somebody else is holding the global semaphore facility lock
- * then sleep until it is released.
- */
- while (semlock_holder != NULL && semlock_holder != p) {
-#ifdef SEM_DEBUG
- printf("semaphore facility locked - sleeping ...\n");
-#endif
- (void) tsleep((caddr_t)&semlock_holder, (PZERO - 4), "semext", 0);
- }
-
did_something = 0;
/*
@@ -911,7 +842,7 @@ semexit(p)
}
if (suptr == NULL)
- goto unlock;
+ return;
#ifdef SEM_DEBUG
printf("proc @%08x has undo structure with %d entries\n", p,
@@ -972,14 +903,4 @@ semexit(p)
#endif
suptr->un_proc = NULL;
*supptr = suptr->un_next;
-
-unlock:
- /*
- * If the exiting process is holding the global semaphore facility
- * lock 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 1a990288e416..f1d1d0ee8a50 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -157,14 +157,6 @@ extern int *semu; /* undo structure pool */
* Process sem_undo vectors at proc exit.
*/
void semexit __P((struct proc *p));
-
-/*
- * Parameters to the semconfig system call
- */
-typedef enum {
- SEM_CONFIG_FREEZE, /* Freeze the semaphore facility. */
- SEM_CONFIG_THAW /* Thaw the semaphore facility. */
-} semconfig_ctl_t;
#endif /* KERNEL */
#ifndef KERNEL
diff --git a/sys/sys/syscall-hide.h b/sys/sys/syscall-hide.h
index a35807e9bb7e..7bfff0ea47cb 100644
--- a/sys/sys/syscall-hide.h
+++ b/sys/sys/syscall-hide.h
@@ -2,7 +2,8 @@
* System call hiders.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.29.2.3 1997/09/03 06:31:56 peter Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.29.2.5 2000/05/01 11:22:17 peter Exp
*/
HIDE_POSIX(fork)
@@ -200,7 +201,6 @@ HIDE_BSD(utrace)
HIDE_BSD(__semctl)
HIDE_BSD(semget)
HIDE_BSD(semop)
-HIDE_BSD(semconfig)
HIDE_BSD(msgctl)
HIDE_BSD(msgget)
HIDE_BSD(msgsnd)
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 8cc457e85248..1b9633cfbd17 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -2,7 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.29.2.3 1997/09/03 06:31:56 peter Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.29.2.5 2000/05/01 11:22:17 peter Exp
*/
#define SYS_syscall 0
@@ -194,7 +195,6 @@
#define SYS___semctl 220
#define SYS_semget 221
#define SYS_semop 222
-#define SYS_semconfig 223
#define SYS_msgctl 224
#define SYS_msgget 225
#define SYS_msgsnd 226
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index 6de8d1227d4d..58cea6a87d24 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -2,7 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.29.2.3 1997/09/03 06:31:56 peter Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.29.2.5 2000/05/01 11:22:17 peter Exp
*/
#ifndef _SYS_SYSPROTO_H_
@@ -673,9 +674,6 @@ struct semop_args {
struct sembuf * sops;
u_int nsops;
};
-struct semconfig_args {
- int flag;
-};
struct msgctl_args {
int msqid;
int cmd;
@@ -890,7 +888,6 @@ int lkmnosys __P((struct proc *, struct nosys_args *, int []));
int __semctl __P((struct proc *, struct __semctl_args *, int []));
int semget __P((struct proc *, struct semget_args *, int []));
int semop __P((struct proc *, struct semop_args *, int []));
-int semconfig __P((struct proc *, struct semconfig_args *, int []));
int msgctl __P((struct proc *, struct msgctl_args *, int []));
int msgget __P((struct proc *, struct msgget_args *, int []));
int msgsnd __P((struct proc *, struct msgsnd_args *, int []));