From ac89850df5e32884978600c33d378553679dd14f Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Thu, 13 Feb 2014 08:58:07 +0100
Subject: [PATCH] kernel: Remove {msg,sem,shm}sys() syscalls.

They have become obsolete with the recent sysvipc userland work
and are not implemented in userspace either.

Thanks to marino for verifying that this doesn't break any package
building.

Pointed-out-by: Mihai Carabas
---
 lib/libc/gen/Symbol.map        |   1 -
 lib/libc/gen/semconfig.c       |  11 ++---
 lib/libc/gen/sysvipc_semctl.c  |   7 +--
 lib/libc/i386/sys/Makefile.inc |   2 +-
 lib/libc/sys/Symbol.map        |   8 ----
 sys/kern/init_sysent.c         |   6 +--
 sys/kern/syscalls.c            |   6 +--
 sys/kern/syscalls.master       |  11 ++---
 sys/kern/sysv_ipc.c            |   6 ---
 sys/kern/sysv_msg.c            |  33 -------------
 sys/kern/sysv_sem.c            |  31 ------------
 sys/kern/sysv_shm.c            | 105 -----------------------------------------
 sys/sys/msg.h                  |   2 -
 sys/sys/sem.h                  |   2 -
 sys/sys/shm.h                  |   1 -
 sys/sys/syscall.h              |   6 +--
 sys/sys/syscall.mk             |   3 --
 sys/sys/sysproto.h             |  33 -------------
 sys/sys/sysunion.h             |   3 --
 19 files changed, 22 insertions(+), 255 deletions(-)

diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 61a76a7..7699258 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -346,7 +346,6 @@ DF306.0 {
     semctl;
     semget;
     semop;
-    semsys;
     set_mcontext;
     setcontext;
     setdomainname;
diff --git a/lib/libc/gen/semconfig.c b/lib/libc/gen/semconfig.c
index 6f5a307..9212621 100644
--- a/lib/libc/gen/semconfig.c
+++ b/lib/libc/gen/semconfig.c
@@ -1,12 +1,11 @@
-/*
- * $DragonFly: src/lib/libc/gen/semconfig.c,v 1.2 2005/11/13 00:07:42 swildner Exp $
- */
-
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
 
-int semconfig(int cmd, int p1, int p2, int p3)
+#include <errno.h>
+
+int
+semconfig(int cmd, int p1, int p2, int p3)
 {
-	return (semsys(3, cmd, p1, p2, p3));
+	return EINVAL;
 }
diff --git a/lib/libc/gen/sysvipc_semctl.c b/lib/libc/gen/sysvipc_semctl.c
index 032fda6..74c2816 100644
--- a/lib/libc/gen/sysvipc_semctl.c
+++ b/lib/libc/gen/sysvipc_semctl.c
@@ -2,18 +2,19 @@
 #include <sys/ipc.h>
 #include <sys/sem.h>
 #include <stdarg.h>
-#include <stdlib.h>
 
 #include "sysvipc_sem.h"
 
 extern char sysvipc_userland;
+extern int __sys___semctl(int, int, int, union semun *);
 
 int
 semctl(int semid, int semnum, int cmd, ...)
 {
 	va_list ap;
-	union semun semun = {0};
+	union semun semun = { 0 };
 	union semun *semun_ptr = NULL;
+
 	va_start(ap, cmd);
 	if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL
 	    || cmd == SETVAL || cmd == SETALL) {
@@ -24,5 +25,5 @@ semctl(int semid, int semnum, int cmd, ...)
 
 	if (sysvipc_userland)
 		return (sysvipc___semctl(semid, semnum, cmd, semun_ptr));
-	return (semsys(0, semid, semnum, cmd, semun_ptr));
+	return (__sys___semctl(semid, semnum, cmd, semun_ptr));
 }
diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc
index 85bf3cd..558d35c 100644
--- a/lib/libc/i386/sys/Makefile.inc
+++ b/lib/libc/i386/sys/Makefile.inc
@@ -8,7 +8,7 @@ MDASM=	Ovfork.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S \
 	reboot.S rfork.S sbrk.S setlogin.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:
-NOASM=	__semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \
+NOASM=	break.o exit.o ftruncate.o getdomainname.o getlogin.o \
 	lseek.o mmap.o openbsd_poll.o semconfig.o setdomainname.o sstk.o \
 	truncate.o uname.o vfork.o yield.o fork.o
 
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index c6cc495..940e6f4 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -153,7 +153,6 @@ DF306.0 {
     mq_unlink;
     msgctl;
     msync;
-    msgsys;
     munlock;
     munlockall;
     munmap;
@@ -225,7 +224,6 @@ DF306.0 {
     shmctl;
     shmdt;
     shmget;
-    shmsys;
     shutdown;
     sigaction;
     sigaltstack;
@@ -450,7 +448,6 @@ DFprivate_1.0 {
     __sys_mq_timedreceive;
     __sys_mq_timedsend;
     __sys_mq_unlink;
-    __sys_msgsys;
     __sys_msync;
     __sys_munlock;
     __sys_munlockall;
@@ -491,7 +488,6 @@ DFprivate_1.0 {
     __sys_sched_setscheduler;
     __sys_sched_yield;
     __sys_select;
-    __sys_semsys;
     __sys_sendfile;
     __sys_sendmsg;
     __sys_sendto;
@@ -517,7 +513,6 @@ DFprivate_1.0 {
     __sys_shmctl;
     __sys_shmdt;
     __sys_shmget;
-    __sys_shmsys;
     __sys_shutdown;
     __sys_sigaction;
     __sys_sigaltstack;
@@ -735,7 +730,6 @@ DFprivate_1.0 {
     _mq_timedreceive;
     _mq_timedsend;
     _mq_unlink;
-    _msgsys;
     _msync;
     _munlock;
     _munlockall;
@@ -786,7 +780,6 @@ DFprivate_1.0 {
     _sem_trywait;
     _sem_unlink;
     _sem_wait;
-    _semsys;
     _sendfile;
     _sendmsg;
     _sendto;
@@ -812,7 +805,6 @@ DFprivate_1.0 {
     _shmctl;
     _shmdt;
     _shmget;
-    _shmsys;
     _shutdown;
     _sigaction;
     _sigaltstack;
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index 6de4d6a..0951244 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -205,9 +205,9 @@ struct sysent sysent[] = {
 	{ AS(rtprio_args), (sy_call_t *)sys_rtprio },	/* 166 = rtprio */
 	{ 0, (sy_call_t *)sys_nosys },			/* 167 = nosys */
 	{ 0, (sy_call_t *)sys_nosys },			/* 168 = nosys */
-	{ AS(semsys_args), (sy_call_t *)sys_semsys },	/* 169 = semsys */
-	{ AS(msgsys_args), (sy_call_t *)sys_msgsys },	/* 170 = msgsys */
-	{ AS(shmsys_args), (sy_call_t *)sys_shmsys },	/* 171 = shmsys */
+	{ 0, (sy_call_t *)sys_nosys },			/* 169 = obsolete semsys */
+	{ 0, (sy_call_t *)sys_nosys },			/* 170 = obsolete msgsys */
+	{ 0, (sy_call_t *)sys_nosys },			/* 171 = obsolete shmsys */
 	{ 0, (sy_call_t *)sys_nosys },			/* 172 = nosys */
 	{ AS(extpread_args), (sy_call_t *)sys_extpread },	/* 173 = extpread */
 	{ AS(extpwrite_args), (sy_call_t *)sys_extpwrite },	/* 174 = extpwrite */
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 021bd26..62ad164 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -177,9 +177,9 @@ const char *syscallnames[] = {
 	"rtprio",			/* 166 = rtprio */
 	"#167",			/* 167 = nosys */
 	"#168",			/* 168 = nosys */
-	"semsys",			/* 169 = semsys */
-	"msgsys",			/* 170 = msgsys */
-	"shmsys",			/* 171 = shmsys */
+	"obs_semsys",			/* 169 = obsolete semsys */
+	"obs_msgsys",			/* 170 = obsolete msgsys */
+	"obs_shmsys",			/* 171 = obsolete shmsys */
 	"#172",			/* 172 = nosys */
 	"extpread",			/* 173 = extpread */
 	"extpwrite",			/* 174 = extpwrite */
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index e3b9149..141056e 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -265,14 +265,9 @@
 			    struct rtprio *rtp); }
 167	UNIMPL	nosys
 168	UNIMPL	nosys
-169	STD	{ int semsys(int which, int a2, int a3, int a4, \
-			    int a5); }
-; XXX should be		{ int semsys(int which, ...); }
-170	STD	{ int msgsys(int which, int a2, int a3, int a4, \
-			    int a5, int a6); }
-; XXX should be		{ int msgsys(int which, ...); }
-171	STD	{ int shmsys(int which, int a2, int a3, int a4); }
-; XXX should be		{ int shmsys(int which, ...); }
+169	OBSOL	semsys
+170	OBSOL	msgsys
+171	OBSOL	shmsys
 172	UNIMPL	nosys
 173	STD	{ ssize_t extpread(int fd, void *buf, \
 			    size_t nbyte, int flags, off_t offset); }
diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c
index 203d082..fd10447 100644
--- a/sys/kern/sysv_ipc.c
+++ b/sys/kern/sysv_ipc.c
@@ -1,5 +1,4 @@
 /* $FreeBSD: src/sys/kern/sysv_ipc.c,v 1.13.2.2 2000/07/01 14:33:49 bsd Exp $ */
-/* $DragonFly: src/sys/kern/sysv_ipc.c,v 1.8 2005/10/08 14:31:26 corecode Exp $ */
 /*	$NetBSD: sysv_ipc.c,v 1.7 1994/06/29 06:33:11 cgd Exp $	*/
 
 /*
@@ -107,7 +106,6 @@ sysv_nosys(char *s)
  * SYSVSEM stubs
  */
 
-SYSCALL_NOT_PRESENT_GEN(semsys, "SYSVSEM");
 SYSCALL_NOT_PRESENT_GEN(__semctl, "SYSVSEM");
 SYSCALL_NOT_PRESENT_GEN(semget, "SYSVSEM");
 SYSCALL_NOT_PRESENT_GEN(semop, "SYSVSEM");
@@ -126,11 +124,8 @@ semexit(struct proc *p)
 
 /*
  * SYSVMSG stubs
- * 
- * note: msgsys args actually var-args? YYYY
  */
 
-SYSCALL_NOT_PRESENT_GEN(msgsys, "SYSVMSG");
 SYSCALL_NOT_PRESENT_GEN(msgctl, "SYSVMSG");
 SYSCALL_NOT_PRESENT_GEN(msgget, "SYSVMSG");
 SYSCALL_NOT_PRESENT_GEN(msgsnd, "SYSVMSG");
@@ -149,7 +144,6 @@ SYSCALL_NOT_PRESENT_GEN(shmdt, "SYSVSHM");
 SYSCALL_NOT_PRESENT_GEN(shmat, "SYSVSHM");
 SYSCALL_NOT_PRESENT_GEN(shmctl, "SYSVSHM");
 SYSCALL_NOT_PRESENT_GEN(shmget, "SYSVSHM");
-SYSCALL_NOT_PRESENT_GEN(shmsys, "SYSVSHM");
 
 /* called from kern_fork.c */
 void
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index e0003a9..cd9709f 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -44,12 +44,6 @@ static void msginit (void *);
 
 static void msg_freehdr (struct msg *msghdr);
 
-/* XXX casting to (sy_call_t *) is bogus, as usual. */
-static sy_call_t *msgcalls[] = {
-	(sy_call_t *)sys_msgctl, (sy_call_t *)sys_msgget,
-	(sy_call_t *)sys_msgsnd, (sy_call_t *)sys_msgrcv
-};
-
 struct msg {
 	struct	msg *msg_next;	/* next msg in the chain */
 	long	msg_type;	/* type of this message */
@@ -180,33 +174,6 @@ msginit(void *dummy)
 }
 SYSINIT(sysv_msg, SI_SUB_SYSV_MSG, SI_ORDER_FIRST, msginit, NULL)
 
-/*
- * Entry point for all MSG calls
- *
- * msgsys_args(int which, int a2, ...) (VARARGS)
- *
- * MPALMOSTSAFE
- */
-int
-sys_msgsys(struct msgsys_args *uap)
-{
-	struct thread *td = curthread;
-	unsigned int which = (unsigned int)uap->which;
-	int error;
-
-	if (!jail_sysvipc_allowed && td->td_ucred->cr_prison != NULL)
-		return (ENOSYS);
-
-	if (which >= NELEM(msgcalls))
-		return (EINVAL);
-	bcopy(&uap->a2, &uap->which,
-	      sizeof(struct msgsys_args) - offsetof(struct msgsys_args, a2));
-	get_mplock();
-	error = (*msgcalls[which])(uap);
-	rel_mplock();
-	return (error);
-}
-
 static void
 msg_freehdr(struct msg *msghdr)
 {
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index addc6ed..c8c1d1f 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -32,12 +32,6 @@ static struct sem_undo *semu_alloc (struct proc *p);
 static int semundo_adjust (struct proc *p, int semid, int semnum, int adjval);
 static void semundo_clear (int semid, int semnum);
 
-/* XXX casting to (sy_call_t *) is bogus, as usual. */
-static sy_call_t *semcalls[] = {
-	(sy_call_t *)sys___semctl, (sy_call_t *)sys_semget,
-	(sy_call_t *)sys_semop
-};
-
 static struct lwkt_token semu_token = LWKT_TOKEN_INITIALIZER(semu_token);
 static int	semtot = 0;
 static struct semid_pool *sema;	/* semaphore id pool */
@@ -189,31 +183,6 @@ seminit(void *dummy)
 SYSINIT(sysv_sem, SI_SUB_SYSV_SEM, SI_ORDER_FIRST, seminit, NULL)
 
 /*
- * Entry point for all SEM calls
- *
- * semsys_args(int which, a2, a3, ...) (VARARGS)
- *
- * MPALMOSTSAFE
- */
-int
-sys_semsys(struct semsys_args *uap)
-{
-	struct thread *td = curthread;
-	unsigned int which = (unsigned int)uap->which;
-	int error;
-
-	if (!jail_sysvipc_allowed && td->td_ucred->cr_prison != NULL)
-		return (ENOSYS);
-
-	if (which >= NELEM(semcalls))
-		return (EINVAL);
-	bcopy(&uap->a2, &uap->which,
-	      sizeof(struct semsys_args) - offsetof(struct semsys_args, a2));
-	error = (*semcalls[which])(uap);
-	return (error);
-}
-
-/*
  * Allocate a new sem_undo structure for a process
  * (returns ptr to structure or NULL if no more room)
  */
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index a399271..8edd773 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -57,19 +57,9 @@
 
 static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments");
 
-struct oshmctl_args;
-static int sys_oshmctl (struct proc *p, struct oshmctl_args *uap);
-
 static int shmget_allocate_segment (struct proc *p, struct shmget_args *uap, int mode);
 static int shmget_existing (struct proc *p, struct shmget_args *uap, int mode, int segnum);
 
-/* XXX casting to (sy_call_t *) is bogus, as usual. */
-static sy_call_t *shmcalls[] = {
-	(sy_call_t *)sys_shmat, (sy_call_t *)sys_oshmctl,
-	(sy_call_t *)sys_shmdt, (sy_call_t *)sys_shmget,
-	(sy_call_t *)sys_shmctl
-};
-
 #define	SHMSEG_FREE     	0x0200
 #define	SHMSEG_REMOVED  	0x0400
 #define	SHMSEG_ALLOCATED	0x0800
@@ -368,75 +358,6 @@ done:
 	return error;
 }
 
-struct oshmid_ds {
-	struct	ipc_perm shm_perm;	/* operation perms */
-	int	shm_segsz;		/* size of segment (bytes) */
-	ushort	shm_cpid;		/* pid, creator */
-	ushort	shm_lpid;		/* pid, last operation */
-	short	shm_nattch;		/* no. of current attaches */
-	time_t	shm_atime;		/* last attach time */
-	time_t	shm_dtime;		/* last detach time */
-	time_t	shm_ctime;		/* last change time */
-	void	*shm_handle;		/* internal handle for shm segment */
-};
-
-struct oshmctl_args {
-	struct sysmsg sysmsg;
-	int shmid;
-	int cmd;
-	struct oshmid_ds *ubuf;
-};
-
-/*
- * MPALMOSTSAFE
- */
-static int
-sys_oshmctl(struct proc *p, struct oshmctl_args *uap)
-{
-#ifdef COMPAT_43
-	struct thread *td = curthread;
-	struct shmid_ds *shmseg;
-	struct oshmid_ds outbuf;
-	int error;
-
-	if (!jail_sysvipc_allowed && td->td_ucred->cr_prison != NULL)
-		return (ENOSYS);
-
-	get_mplock();
-	shmseg = shm_find_segment_by_shmid(uap->shmid);
-	if (shmseg == NULL) {
-		error = EINVAL;
-		goto done;
-	}
-
-	switch (uap->cmd) {
-	case IPC_STAT:
-		error = ipcperm(p, &shmseg->shm_perm, IPC_R);
-		if (error)
-			break;
-		outbuf.shm_perm = shmseg->shm_perm;
-		outbuf.shm_segsz = shmseg->shm_segsz;
-		outbuf.shm_cpid = shmseg->shm_cpid;
-		outbuf.shm_lpid = shmseg->shm_lpid;
-		outbuf.shm_nattch = shmseg->shm_nattch;
-		outbuf.shm_atime = shmseg->shm_atime;
-		outbuf.shm_dtime = shmseg->shm_dtime;
-		outbuf.shm_ctime = shmseg->shm_ctime;
-		outbuf.shm_handle = shmseg->shm_internal;
-		error = copyout((caddr_t)&outbuf, uap->ubuf, sizeof(outbuf));
-		break;
-	default:
-		/* XXX casting to (sy_call_t *) is bogus, as usual. */
-		error = sys_shmctl((struct shmctl_args *)uap);
-	}
-done:
-	rel_mplock();
-	return error;
-#else
-	return EINVAL;
-#endif
-}
-
 /*
  * MPALMOSTSAFE
  */
@@ -679,32 +600,6 @@ done:
 	return (error);
 }
 
-/*
- * shmsys_args(int which, int a2, ...) (VARARGS)
- *
- * MPALMOSTSAFE
- */
-int
-sys_shmsys(struct shmsys_args *uap)
-{
-	struct thread *td = curthread;
-	unsigned int which = (unsigned int)uap->which;
-	int error;
-
-	if (!jail_sysvipc_allowed && td->td_ucred->cr_prison != NULL)
-		return (ENOSYS);
-
-	if (which >= NELEM(shmcalls))
-		return EINVAL;
-	get_mplock();
-	bcopy(&uap->a2, &uap->which,
-		sizeof(struct shmsys_args) - offsetof(struct shmsys_args, a2));
-	error = ((*shmcalls[which])(uap));
-	rel_mplock();
-
-	return(error);
-}
-
 void
 shmfork(struct proc *p1, struct proc *p2)
 {
diff --git a/sys/sys/msg.h b/sys/sys/msg.h
index 7542dc4..1fa89af 100644
--- a/sys/sys/msg.h
+++ b/sys/sys/msg.h
@@ -1,5 +1,4 @@
 /* $FreeBSD: src/sys/sys/msg.h,v 1.10.2.1 2000/08/04 22:31:10 peter Exp $ */
-/* $DragonFly: src/sys/sys/msg.h,v 1.4 2003/08/27 02:03:22 dillon Exp $ */
 /*	$NetBSD: msg.h,v 1.4 1994/06/29 06:44:43 cgd Exp $	*/
 
 /*
@@ -105,7 +104,6 @@ extern struct msginfo	msginfo;
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-int msgsys (int, ...);
 int msgctl (int, int, struct msqid_ds *);
 int msgget (key_t, int);
 int msgsnd (int, void *, size_t, int);
diff --git a/sys/sys/sem.h b/sys/sys/sem.h
index 6dca474..0549f5a 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -1,5 +1,4 @@
 /* $FreeBSD: src/sys/sys/sem.h,v 1.20.2.2 2000/08/04 22:31:10 peter Exp $ */
-/* $DragonFly: src/sys/sys/sem.h,v 1.4 2003/08/27 02:03:22 dillon Exp $ */
 /*	$NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $	*/
 
 /*
@@ -117,7 +116,6 @@ extern struct seminfo	seminfo;
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-int semsys (int, ...);
 int semctl (int, int, int, ...);
 int semget (key_t, int, int);
 int semop (int, struct sembuf *,unsigned);
diff --git a/sys/sys/shm.h b/sys/sys/shm.h
index 1c9ccbb..8bfc58a 100644
--- a/sys/sys/shm.h
+++ b/sys/sys/shm.h
@@ -95,7 +95,6 @@ void	shmfork (struct proc *, struct proc *);
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-int shmsys (int, ...);
 int shmget (key_t, size_t, int);
 int shmctl (int, int, struct shmid_ds *);
 void *shmat  (int, const void *, int);
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index c04cce2..0cf2913 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -163,9 +163,9 @@
 #define	SYS_uname	164
 #define	SYS_sysarch	165
 #define	SYS_rtprio	166
-#define	SYS_semsys	169
-#define	SYS_msgsys	170
-#define	SYS_shmsys	171
+				/* 169 is obsolete semsys */
+				/* 170 is obsolete msgsys */
+				/* 171 is obsolete shmsys */
 #define	SYS_extpread	173
 #define	SYS_extpwrite	174
 #define	SYS_ntp_adjtime	176
diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk
index 4f48f17..16e6f92 100644
--- a/sys/sys/syscall.mk
+++ b/sys/sys/syscall.mk
@@ -114,9 +114,6 @@ MIASM =  \
 	uname.o \
 	sysarch.o \
 	rtprio.o \
-	semsys.o \
-	msgsys.o \
-	shmsys.o \
 	extpread.o \
 	extpwrite.o \
 	ntp_adjtime.o \
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index a696e4e..61acfd0 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -858,36 +858,6 @@ struct	rtprio_args {
 	pid_t	pid;	char pid_[PAD_(pid_t)];
 	struct rtprio *	rtp;	char rtp_[PAD_(struct rtprio *)];
 };
-struct	semsys_args {
-#ifdef _KERNEL
-	struct sysmsg sysmsg;
-#endif
-	int	which;	char which_[PAD_(int)];
-	int	a2;	char a2_[PAD_(int)];
-	int	a3;	char a3_[PAD_(int)];
-	int	a4;	char a4_[PAD_(int)];
-	int	a5;	char a5_[PAD_(int)];
-};
-struct	msgsys_args {
-#ifdef _KERNEL
-	struct sysmsg sysmsg;
-#endif
-	int	which;	char which_[PAD_(int)];
-	int	a2;	char a2_[PAD_(int)];
-	int	a3;	char a3_[PAD_(int)];
-	int	a4;	char a4_[PAD_(int)];
-	int	a5;	char a5_[PAD_(int)];
-	int	a6;	char a6_[PAD_(int)];
-};
-struct	shmsys_args {
-#ifdef _KERNEL
-	struct sysmsg sysmsg;
-#endif
-	int	which;	char which_[PAD_(int)];
-	int	a2;	char a2_[PAD_(int)];
-	int	a3;	char a3_[PAD_(int)];
-	int	a4;	char a4_[PAD_(int)];
-};
 struct	extpread_args {
 #ifdef _KERNEL
 	struct sysmsg sysmsg;
@@ -2717,9 +2687,6 @@ int	sys_setdomainname (struct setdomainname_args *);
 int	sys_uname (struct uname_args *);
 int	sys_sysarch (struct sysarch_args *);
 int	sys_rtprio (struct rtprio_args *);
-int	sys_semsys (struct semsys_args *);
-int	sys_msgsys (struct msgsys_args *);
-int	sys_shmsys (struct shmsys_args *);
 int	sys_extpread (struct extpread_args *);
 int	sys_extpwrite (struct extpwrite_args *);
 int	sys_ntp_adjtime (struct ntp_adjtime_args *);
diff --git a/sys/sys/sysunion.h b/sys/sys/sysunion.h
index f9acb9f..4cef34a 100644
--- a/sys/sys/sysunion.h
+++ b/sys/sys/sysunion.h
@@ -206,9 +206,6 @@ union sysunion {
 	struct	uname_args uname;
 	struct	sysarch_args sysarch;
 	struct	rtprio_args rtprio;
-	struct	semsys_args semsys;
-	struct	msgsys_args msgsys;
-	struct	shmsys_args shmsys;
 	struct	extpread_args extpread;
 	struct	extpwrite_args extpwrite;
 	struct	ntp_adjtime_args ntp_adjtime;
-- 
1.8.4.1

