summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 11:24:47 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 11:24:47 +0000
commit152690e833bd62e71c2becaf54c074ad57d6c620 (patch)
treec4ac156af48fc514a5aab66caf08519d6fff741c /sys
parent3ec9471564351d78de37089e493304b0c3da0dc7 (diff)
Rename structs oipc_perm, omsqid_ds, osemid_ds, oshmid_ds to ipc_perm23,
etc to avoid confusion and for consistency with the *35 ones. Remove *n2o functions that don't belong outside of compat.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/syscalls.master8
-rw-r--r--sys/kern/sysv_ipc.c31
-rw-r--r--sys/kern/sysv_msg.c24
-rw-r--r--sys/kern/sysv_sem.c15
-rw-r--r--sys/kern/sysv_shm.c17
-rw-r--r--sys/sys/ipc.h10
-rw-r--r--sys/sys/msg.h7
-rw-r--r--sys/sys/sem.h7
-rw-r--r--sys/sys/shm.h9
9 files changed, 22 insertions, 106 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 2c8052a6b56..d87a1a3d2c7 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.74 2004/07/14 23:45:11 millert Exp $
+; $OpenBSD: syscalls.master,v 1.75 2004/07/15 11:24:46 millert Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -424,7 +424,7 @@
; System calls 220-240 are reserved for use by OpenBSD
#ifdef SYSVSEM
220 COMPAT_23 { int sys___semctl(int semid, int semnum, int cmd, \
- union semun *arg); } __osemctl
+ union semun *arg); } semctl23
221 STD { int sys_semget(key_t key, int nsems, int semflg); }
222 COMPAT_35 { int sys_semop(int semid, struct sembuf *sops, \
u_int nsops); }
@@ -437,7 +437,7 @@
#endif
#ifdef SYSVMSG
224 COMPAT_23 { int sys_msgctl(int msqid, int cmd, \
- struct omsqid_ds *buf); } omsgctl
+ struct omsqid_ds *buf); } msgctl23
225 STD { int sys_msgget(key_t key, int msgflg); }
226 STD { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
int msgflg); }
@@ -453,7 +453,7 @@
228 STD { void *sys_shmat(int shmid, const void *shmaddr, \
int shmflg); }
229 COMPAT_23 { int sys_shmctl(int shmid, int cmd, \
- struct oshmid_ds *buf); } oshmctl
+ struct oshmid_ds *buf); } shmctl23
230 STD { int sys_shmdt(const void *shmaddr); }
231 COMPAT_35 { int sys_shmget(key_t key, int size, int shmflg); }
#else
diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c
index de684b9834c..413a33db136 100644
--- a/sys/kern/sysv_ipc.c
+++ b/sys/kern/sysv_ipc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_ipc.c,v 1.3 1998/06/11 18:32:13 deraadt Exp $ */
+/* $OpenBSD: sysv_ipc.c,v 1.4 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: sysv_ipc.c,v 1.10 1995/06/03 05:53:28 mycroft Exp $ */
/*
@@ -62,32 +62,3 @@ ipcperm(cred, perm, mode)
return (0);
return (EACCES);
}
-
-void
-ipc_n2o(n, o)
- struct ipc_perm *n;
- struct oipc_perm *o;
-{
- o->cuid = n->cuid; /* XXX */
- o->cgid = n->cgid; /* XXX */
- o->uid = n->uid; /* XXX */
- o->gid = n->gid; /* XXX */
- o->mode = n->mode; /* XXX */
- o->seq = n->seq;
- o->key = n->key;
-}
-
-void
-ipc_o2n(o, n)
- struct oipc_perm *o;
- struct ipc_perm *n;
-{
- n->cuid = o->cuid; /* XXX */
- n->cgid = o->cgid; /* XXX */
- n->uid = o->uid; /* XXX */
- n->gid = o->gid; /* XXX */
- n->mode = o->mode; /* XXX */
- n->seq = o->seq;
- n->key = o->key;
-}
-
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index 071d839fab7..365c721be80 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_msg.c,v 1.17 2004/07/14 23:40:27 millert Exp $ */
+/* $OpenBSD: sysv_msg.c,v 1.18 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */
/*
@@ -134,28 +134,6 @@ msg_freehdr(msghdr)
free_msghdrs = msghdr;
}
-void
-msqid_n2o(n, o)
- struct msqid_ds *n;
- struct omsqid_ds *o;
-{
- o->msg_first = n->msg_first;
- o->msg_last = n->msg_last;
- o->msg_cbytes = n->msg_cbytes;
- o->msg_qnum = n->msg_qnum;
- o->msg_qbytes = n->msg_qbytes;
- o->msg_lspid = n->msg_lspid;
- o->msg_lrpid = n->msg_lrpid;
- o->msg_stime = n->msg_stime;
- o->msg_pad1 = n->msg_pad1;
- o->msg_rtime = n->msg_rtime;
- o->msg_pad2 = n->msg_pad2;
- o->msg_ctime = n->msg_ctime;
- o->msg_pad3 = n->msg_pad3;
- bcopy(n->msg_pad4, o->msg_pad4, sizeof o->msg_pad4);
- ipc_n2o(&n->msg_perm, &o->msg_perm);
-}
-
int
sys_msgctl(p, v, retval)
struct proc *p;
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 5e86bf14461..e62a3a95530 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_sem.c,v 1.31 2004/07/14 23:40:27 millert Exp $ */
+/* $OpenBSD: sysv_sem.c,v 1.32 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */
/*
@@ -227,19 +227,6 @@ semundo_clear(int semid, int semnum)
}
}
-void
-semid_n2o(struct semid_ds *n, struct osemid_ds *o)
-{
- o->sem_base = n->sem_base;
- o->sem_nsems = n->sem_nsems;
- o->sem_otime = n->sem_otime;
- o->sem_pad1 = n->sem_pad1;
- o->sem_ctime = n->sem_ctime;
- o->sem_pad2 = n->sem_pad2;
- bcopy(n->sem_pad3, o->sem_pad3, sizeof o->sem_pad3);
- ipc_n2o(&n->sem_perm, &o->sem_perm);
-}
-
int
sys___semctl(struct proc *p, void *v, register_t *retval)
{
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index df588682aea..c7292abcaa0 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_shm.c,v 1.45 2004/07/14 23:40:27 millert Exp $ */
+/* $OpenBSD: sysv_shm.c,v 1.46 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */
/*
@@ -549,21 +549,6 @@ shminit(void)
shm_committed = 0;
}
-void
-shmid_n2o(struct shmid_ds *n, struct oshmid_ds *o)
-{
-
- o->shm_segsz = n->shm_segsz;
- o->shm_lpid = n->shm_lpid;
- o->shm_cpid = n->shm_cpid;
- o->shm_nattch = n->shm_nattch;
- o->shm_atime = n->shm_atime;
- o->shm_dtime = n->shm_dtime;
- o->shm_ctime = n->shm_ctime;
- o->shm_internal = n->shm_internal;
- ipc_n2o(&n->shm_perm, &o->shm_perm);
-}
-
/*
* Userland access to struct shminfo.
*/
diff --git a/sys/sys/ipc.h b/sys/sys/ipc.h
index 948fdfac8ee..888064420cb 100644
--- a/sys/sys/ipc.h
+++ b/sys/sys/ipc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipc.h,v 1.9 2004/07/14 23:45:11 millert Exp $ */
+/* $OpenBSD: ipc.h,v 1.10 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: ipc.h,v 1.15 1996/02/09 18:25:12 christos Exp $ */
/*
@@ -59,7 +59,7 @@ struct ipc_perm {
};
#ifdef _KERNEL
-struct oipc_perm {
+struct ipc_perm23 {
unsigned short cuid; /* creator user id */
unsigned short cgid; /* creator group id */
unsigned short uid; /* user id */
@@ -103,11 +103,9 @@ struct ipc_perm35 {
#define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff))
int ipcperm(struct ucred *, struct ipc_perm *, int);
-void ipc_n2o(struct ipc_perm *, struct oipc_perm *);
-void ipc_o2n(struct oipc_perm *, struct ipc_perm *);
-#endif /* _KERNEL */
-#ifndef _KERNEL
+#else /* !_KERNEL */
+
#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/sys/sys/msg.h b/sys/sys/msg.h
index 7a59ad90ee6..59b23f335fd 100644
--- a/sys/sys/msg.h
+++ b/sys/sys/msg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.h,v 1.12 2004/07/14 23:45:11 millert Exp $ */
+/* $OpenBSD: msg.h,v 1.13 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: msg.h,v 1.9 1996/02/09 18:25:18 christos Exp $ */
/*
@@ -51,8 +51,8 @@ struct msqid_ds {
};
#ifdef _KERNEL
-struct omsqid_ds {
- struct oipc_perm msg_perm; /* msg queue permission bits */
+struct msqid_ds23 {
+ struct ipc_perm23 msg_perm; /* msg queue permission bits */
struct msg *msg_first; /* first message in the queue */
struct msg *msg_last; /* last message in the queue */
unsigned long msg_cbytes; /* number of bytes in use on the queue */
@@ -205,7 +205,6 @@ __END_DECLS
struct proc;
void msginit(void);
-void msqid_n2o(struct msqid_ds *, struct omsqid_ds *);
int msgctl1(struct proc *, int, int, caddr_t,
int (*)(const void *, void *, size_t),
int (*)(const void *, void *, size_t));
diff --git a/sys/sys/sem.h b/sys/sys/sem.h
index 1414f7ca149..21dd32758b0 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sem.h,v 1.17 2004/07/14 23:45:11 millert Exp $ */
+/* $OpenBSD: sem.h,v 1.18 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: sem.h,v 1.8 1996/02/09 18:25:29 christos Exp $ */
/*
@@ -65,8 +65,8 @@ struct semid_ds {
};
#ifdef _KERNEL
-struct osemid_ds {
- struct oipc_perm sem_perm; /* operation permission struct */
+struct semid_ds23 {
+ struct ipc_perm23 sem_perm; /* operation permission struct */
struct sem *sem_base; /* pointer to first semaphore in set */
unsigned short sem_nsems; /* number of sems in set */
time_t sem_otime; /* last operation time */
@@ -217,7 +217,6 @@ __END_DECLS
#else
void seminit(void);
void semexit(struct proc *);
-void semid_n2o(struct semid_ds *, struct osemid_ds *);
int sysctl_sysvsem(int *, u_int, void *, size_t *, void *, size_t);
int semctl1(struct proc *, int, int, int, union semun *, register_t *,
int (*)(const void *, void *, size_t),
diff --git a/sys/sys/shm.h b/sys/sys/shm.h
index aeb99f385c4..86bc981540b 100644
--- a/sys/sys/shm.h
+++ b/sys/sys/shm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: shm.h,v 1.18 2004/07/14 23:45:11 millert Exp $ */
+/* $OpenBSD: shm.h,v 1.19 2004/07/15 11:24:46 millert Exp $ */
/* $NetBSD: shm.h,v 1.20 1996/04/09 20:55:35 cgd Exp $ */
/*
@@ -109,12 +109,12 @@ struct shmid_ds {
};
#ifdef _KERNEL
-struct oshmid_ds {
- struct oipc_perm shm_perm; /* operation permission structure */
+struct shmid_ds23 {
+ struct ipc_perm23 shm_perm; /* operation permission structure */
int shm_segsz; /* size of segment in bytes */
pid_t shm_lpid; /* process ID of last shm op */
pid_t shm_cpid; /* process ID of creator */
- short shm_nattch; /* number of current attaches */
+ shmatt_t shm_nattch; /* number of current attaches */
time_t shm_atime; /* time of last shmat() */
time_t shm_dtime; /* time of last shmdt() */
time_t shm_ctime; /* time of last change by shmctl() */
@@ -167,7 +167,6 @@ struct vmspace;
void shminit(void);
void shmfork(struct vmspace *, struct vmspace *);
void shmexit(struct vmspace *);
-void shmid_n2o(struct shmid_ds *, struct oshmid_ds *);
int sysctl_sysvshm(int *, u_int, void *, size_t *, void *, size_t);
int sys_shmat1(struct proc *, void *, register_t *, int);
int shmctl1(struct proc *, int, int, caddr_t,