diff options
-rw-r--r-- | sys/kern/sys_generic.c | 101 | ||||
-rw-r--r-- | sys/kern/sys_pipe.c | 63 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 7 | ||||
-rw-r--r-- | sys/kern/sys_socket.c | 36 | ||||
-rw-r--r-- | sys/kern/sysv_ipc.c | 7 | ||||
-rw-r--r-- | sys/kern/sysv_msg.c | 57 |
6 files changed, 72 insertions, 199 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index b1e2cd19144..584d4f87783 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.50 2005/08/01 06:26:16 deraadt Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.51 2005/12/13 10:33:14 jsg Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -71,10 +71,7 @@ void pollscan(struct proc *, struct pollfd *, u_int, register_t *); */ /* ARGSUSED */ int -sys_read(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_read(struct proc *p, void *v, register_t *retval) { struct sys_read_args /* { syscallarg(int) fd; @@ -98,14 +95,8 @@ sys_read(p, v, retval) } int -dofileread(p, fd, fp, buf, nbyte, offset, retval) - struct proc *p; - int fd; - struct file *fp; - void *buf; - size_t nbyte; - off_t *offset; - register_t *retval; +dofileread(struct proc *p, int fd, struct file *fp, void *buf, size_t nbyte, + off_t *offset, register_t *retval) { struct uio auio; struct iovec aiov; @@ -161,10 +152,7 @@ dofileread(p, fd, fp, buf, nbyte, offset, retval) * Scatter read system call. */ int -sys_readv(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_readv(struct proc *p, void *v, register_t *retval) { struct sys_readv_args /* { syscallarg(int) fd; @@ -188,14 +176,8 @@ sys_readv(p, v, retval) } int -dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval) - struct proc *p; - int fd; - struct file *fp; - const struct iovec *iovp; - int iovcnt; - off_t *offset; - register_t *retval; +dofilereadv(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, + int iovcnt, off_t *offset, register_t *retval) { struct uio auio; struct iovec *iov; @@ -282,10 +264,7 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval) * Write system call */ int -sys_write(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_write(struct proc *p, void *v, register_t *retval) { struct sys_write_args /* { syscallarg(int) fd; @@ -309,14 +288,8 @@ sys_write(p, v, retval) } int -dofilewrite(p, fd, fp, buf, nbyte, offset, retval) - struct proc *p; - int fd; - struct file *fp; - const void *buf; - size_t nbyte; - off_t *offset; - register_t *retval; +dofilewrite(struct proc *p, int fd, struct file *fp, const void *buf, + size_t nbyte, off_t *offset, register_t *retval) { struct uio auio; struct iovec aiov; @@ -375,10 +348,7 @@ dofilewrite(p, fd, fp, buf, nbyte, offset, retval) * Gather write system call */ int -sys_writev(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_writev(struct proc *p, void *v, register_t *retval) { struct sys_writev_args /* { syscallarg(int) fd; @@ -402,14 +372,8 @@ sys_writev(p, v, retval) } int -dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval) - struct proc *p; - int fd; - struct file *fp; - const struct iovec *iovp; - int iovcnt; - off_t *offset; - register_t *retval; +dofilewritev(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, + int iovcnt, off_t *offset, register_t *retval) { struct uio auio; struct iovec *iov; @@ -500,10 +464,7 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval) */ /* ARGSUSED */ int -sys_ioctl(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_ioctl(struct proc *p, void *v, register_t *retval) { struct sys_ioctl_args /* { syscallarg(int) fd; @@ -761,17 +722,13 @@ done: } int -selscan(p, ibits, obits, nfd, ni, retval) - struct proc *p; - fd_set *ibits, *obits; - int nfd; - int ni; - register_t *retval; +selscan(struct proc *p, fd_set *ibits, fd_set *obits, int nfd, int ni, + register_t *retval) { caddr_t cibits = (caddr_t)ibits, cobits = (caddr_t)obits; - register struct filedesc *fdp = p->p_fd; - register int msk, i, j, fd; - register fd_mask bits; + struct filedesc *fdp = p->p_fd; + int msk, i, j, fd; + fd_mask bits; struct file *fp; int n = 0; static const int flag[3] = { POLLIN, POLLOUT, POLLPRI }; @@ -801,10 +758,7 @@ selscan(p, ibits, obits, nfd, ni, retval) /*ARGSUSED*/ int -seltrue(dev, events, p) - dev_t dev; - int events; - struct proc *p; +seltrue(dev_t dev, int events, struct proc *p) { return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); @@ -814,9 +768,7 @@ seltrue(dev, events, p) * Record a select request. */ void -selrecord(selector, sip) - struct proc *selector; - struct selinfo *sip; +selrecord(struct proc *selector, struct selinfo *sip) { struct proc *p; pid_t mypid; @@ -835,10 +787,9 @@ selrecord(selector, sip) * Do a wakeup when a selectable event occurs. */ void -selwakeup(sip) - register struct selinfo *sip; +selwakeup(struct selinfo *sip) { - register struct proc *p; + struct proc *p; int s; if (sip->si_selpid == 0) @@ -864,11 +815,7 @@ selwakeup(sip) } void -pollscan(p, pl, nfd, retval) - struct proc *p; - struct pollfd *pl; - u_int nfd; - register_t *retval; +pollscan(struct proc *p, struct pollfd *pl, u_int nfd, register_t *retval) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index b3401ebbf78..6f74615aedc 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.49 2004/07/22 06:13:08 tedu Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.50 2005/12/13 10:33:14 jsg Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -101,10 +101,7 @@ int pipespace(struct pipe *, u_int); /* ARGSUSED */ int -sys_opipe(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_opipe(struct proc *p, void *v, register_t *retval) { struct filedesc *fdp = p->p_fd; struct file *rf, *wf; @@ -169,9 +166,7 @@ free1: * If it fails it will return ENOMEM. */ int -pipespace(cpipe, size) - struct pipe *cpipe; - u_int size; +pipespace(struct pipe *cpipe, u_int size) { caddr_t buffer; @@ -197,8 +192,7 @@ pipespace(cpipe, size) * initialize and allocate VM and memory for pipe */ int -pipe_create(cpipe) - struct pipe *cpipe; +pipe_create(struct pipe *cpipe) { int error; @@ -230,8 +224,7 @@ pipe_create(cpipe) * lock a pipe for I/O, blocking other access */ static __inline int -pipelock(cpipe) - struct pipe *cpipe; +pipelock(struct pipe *cpipe) { int error; while (cpipe->pipe_state & PIPE_LOCK) { @@ -247,8 +240,7 @@ pipelock(cpipe) * unlock a pipe I/O lock */ static __inline void -pipeunlock(cpipe) - struct pipe *cpipe; +pipeunlock(struct pipe *cpipe) { cpipe->pipe_state &= ~PIPE_LOCK; if (cpipe->pipe_state & PIPE_LWANT) { @@ -258,8 +250,7 @@ pipeunlock(cpipe) } static __inline void -pipeselwakeup(cpipe) - struct pipe *cpipe; +pipeselwakeup(struct pipe *cpipe) { if (cpipe->pipe_state & PIPE_SEL) { cpipe->pipe_state &= ~PIPE_SEL; @@ -272,11 +263,7 @@ pipeselwakeup(cpipe) /* ARGSUSED */ int -pipe_read(fp, poff, uio, cred) - struct file *fp; - off_t *poff; - struct uio *uio; - struct ucred *cred; +pipe_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred) { struct pipe *rpipe = (struct pipe *) fp->f_data; int error; @@ -393,11 +380,7 @@ unlocked_error: } int -pipe_write(fp, poff, uio, cred) - struct file *fp; - off_t *poff; - struct uio *uio; - struct ucred *cred; +pipe_write(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred) { int error = 0; int orig_resid; @@ -620,11 +603,7 @@ retrywrite: * we implement a very minimal set of ioctls for compatibility with sockets. */ int -pipe_ioctl(fp, cmd, data, p) - struct file *fp; - u_long cmd; - caddr_t data; - struct proc *p; +pipe_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) { struct pipe *mpipe = (struct pipe *)fp->f_data; @@ -658,10 +637,7 @@ pipe_ioctl(fp, cmd, data, p) } int -pipe_poll(fp, events, p) - struct file *fp; - int events; - struct proc *p; +pipe_poll(struct file *fp, int events, struct proc *p) { struct pipe *rpipe = (struct pipe *)fp->f_data; struct pipe *wpipe; @@ -698,10 +674,7 @@ pipe_poll(fp, events, p) } int -pipe_stat(fp, ub, p) - struct file *fp; - struct stat *ub; - struct proc *p; +pipe_stat(struct file *fp, struct stat *ub, struct proc *p) { struct pipe *pipe = (struct pipe *)fp->f_data; @@ -724,9 +697,7 @@ pipe_stat(fp, ub, p) /* ARGSUSED */ int -pipe_close(fp, p) - struct file *fp; - struct proc *p; +pipe_close(struct file *fp, struct proc *p) { struct pipe *cpipe = (struct pipe *)fp->f_data; @@ -737,8 +708,7 @@ pipe_close(fp, p) } void -pipe_free_kmem(cpipe) - struct pipe *cpipe; +pipe_free_kmem(struct pipe *cpipe) { if (cpipe->pipe_buffer.buffer != NULL) { if (cpipe->pipe_buffer.size > PIPE_SIZE) @@ -754,8 +724,7 @@ pipe_free_kmem(cpipe) * shutdown the pipe */ void -pipeclose(cpipe) - struct pipe *cpipe; +pipeclose(struct pipe *cpipe) { struct pipe *ppipe; if (cpipe) { @@ -870,7 +839,7 @@ filt_pipewrite(struct knote *kn, long hint) } void -pipe_init() +pipe_init(void) { pool_init(&pipe_pool, sizeof(struct pipe), 0, 0, 0, "pipepl", &pool_allocator_nointr); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 84a1145524e..51761bed1e8 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.33 2005/12/11 21:30:31 miod Exp $ */ +/* $OpenBSD: sys_process.c,v 1.34 2005/12/13 10:33:14 jsg Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -71,10 +71,7 @@ * Process debugging system call. */ int -sys_ptrace(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_ptrace(struct proc *p, void *v, register_t *retval) { struct sys_ptrace_args /* { syscallarg(int) req; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 4c367c31de7..45e4aee5444 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.9 2003/09/23 16:51:12 millert Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.10 2005/12/13 10:33:14 jsg Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -54,11 +54,7 @@ struct fileops socketops = { /* ARGSUSED */ int -soo_read(fp, poff, uio, cred) - struct file *fp; - off_t *poff; - struct uio *uio; - struct ucred *cred; +soo_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred) { return (soreceive((struct socket *)fp->f_data, (struct mbuf **)0, @@ -67,11 +63,7 @@ soo_read(fp, poff, uio, cred) /* ARGSUSED */ int -soo_write(fp, poff, uio, cred) - struct file *fp; - off_t *poff; - struct uio *uio; - struct ucred *cred; +soo_write(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred) { return (sosend((struct socket *)fp->f_data, (struct mbuf *)0, @@ -79,13 +71,9 @@ soo_write(fp, poff, uio, cred) } int -soo_ioctl(fp, cmd, data, p) - struct file *fp; - u_long cmd; - register caddr_t data; - struct proc *p; +soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) { - register struct socket *so = (struct socket *)fp->f_data; + struct socket *so = (struct socket *)fp->f_data; switch (cmd) { @@ -140,10 +128,7 @@ soo_ioctl(fp, cmd, data, p) } int -soo_poll(fp, events, p) - struct file *fp; - int events; - struct proc *p; +soo_poll(struct file *fp, int events, struct proc *p) { struct socket *so = (struct socket *)fp->f_data; int revents = 0; @@ -176,10 +161,7 @@ soo_poll(fp, events, p) } int -soo_stat(fp, ub, p) - struct file *fp; - struct stat *ub; - struct proc *p; +soo_stat(struct file *fp, struct stat *ub, struct proc *p) { struct socket *so = (struct socket *)fp->f_data; @@ -192,9 +174,7 @@ soo_stat(fp, ub, p) /* ARGSUSED */ int -soo_close(fp, p) - struct file *fp; - struct proc *p; +soo_close(struct file *fp, struct proc *p) { int error = 0; diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index 413a33db136..80ad3822179 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_ipc.c,v 1.4 2004/07/15 11:24:46 millert Exp $ */ +/* $OpenBSD: sysv_ipc.c,v 1.5 2005/12/13 10:33:14 jsg Exp $ */ /* $NetBSD: sysv_ipc.c,v 1.10 1995/06/03 05:53:28 mycroft Exp $ */ /* @@ -43,10 +43,7 @@ */ int -ipcperm(cred, perm, mode) - struct ucred *cred; - struct ipc_perm *perm; - int mode; +ipcperm(struct ucred *cred, struct ipc_perm *perm, int mode) { if (mode == IPC_M) { diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 365c721be80..d553066de70 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_msg.c,v 1.18 2004/07/15 11:24:46 millert Exp $ */ +/* $OpenBSD: sysv_msg.c,v 1.19 2005/12/13 10:33:14 jsg Exp $ */ /* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */ /* @@ -55,9 +55,9 @@ struct msqid_ds *msqids; /* MSGMNI msqid_ds struct's */ void msg_freehdr(struct msg *); void -msginit() +msginit(void) { - register int i; + int i; /* * msginfo.msgssz should be a power of two for efficiency reasons. @@ -106,8 +106,7 @@ msginit() } void -msg_freehdr(msghdr) - struct msg *msghdr; +msg_freehdr(struct msg *msghdr) { while (msghdr->msg_ts > 0) { short next; @@ -135,12 +134,9 @@ msg_freehdr(msghdr) } int -sys_msgctl(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_msgctl(struct proc *p, void *v, register_t *retval) { - register struct sys_msgctl_args /* { + struct sys_msgctl_args /* { syscallarg(int) msqid; syscallarg(int) cmd; syscallarg(struct msqid_ds *) buf; @@ -151,13 +147,9 @@ sys_msgctl(p, v, retval) } int -msgctl1(p, msqid, cmd, buf, ds_copyin, ds_copyout) - struct proc *p; - int msqid; - int cmd; - caddr_t buf; - int (*ds_copyin)(const void *, void *, size_t); - int (*ds_copyout)(const void *, void *, size_t); +msgctl1(struct proc *p, int msqid, int cmd, caddr_t buf, + int (*ds_copyin)(const void *, void *, size_t), + int (*ds_copyout)(const void *, void *, size_t)) { struct ucred *cred = p->p_ucred; struct msqid_ds msqbuf, *msqptr; @@ -254,12 +246,9 @@ msgctl1(p, msqid, cmd, buf, ds_copyin, ds_copyout) } int -sys_msgget(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_msgget(struct proc *p, void *v, register_t *retval) { - register struct sys_msgget_args /* { + struct sys_msgget_args /* { syscallarg(key_t) key; syscallarg(int) msgflg; } */ *uap = v; @@ -267,7 +256,7 @@ sys_msgget(p, v, retval) int key = SCARG(uap, key); int msgflg = SCARG(uap, msgflg); struct ucred *cred = p->p_ucred; - register struct msqid_ds *msqptr = NULL; + struct msqid_ds *msqptr = NULL; DPRINTF(("msgget(0x%x, 0%o)\n", key, msgflg)); @@ -342,12 +331,9 @@ found: } int -sys_msgsnd(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_msgsnd(struct proc *p, void *v, register_t *retval) { - register struct sys_msgsnd_args /* { + struct sys_msgsnd_args /* { syscallarg(int) msqid; syscallarg(const void *) msgp; syscallarg(size_t) msgsz; @@ -359,8 +345,8 @@ sys_msgsnd(p, v, retval) int msgflg = SCARG(uap, msgflg); int segs_needed, eval; struct ucred *cred = p->p_ucred; - register struct msqid_ds *msqptr; - register struct msg *msghdr; + struct msqid_ds *msqptr; + struct msg *msghdr; short next; DPRINTF(("call to msgsnd(%d, %p, %d, %d)\n", msqid, user_msgp, msgsz, @@ -629,12 +615,9 @@ sys_msgsnd(p, v, retval) } int -sys_msgrcv(p, v, retval) - struct proc *p; - void *v; - register_t *retval; +sys_msgrcv(struct proc *p, void *v, register_t *retval) { - register struct sys_msgrcv_args /* { + struct sys_msgrcv_args /* { syscallarg(int) msqid; syscallarg(void *) msgp; syscallarg(size_t) msgsz; @@ -648,8 +631,8 @@ sys_msgrcv(p, v, retval) int msgflg = SCARG(uap, msgflg); size_t len; struct ucred *cred = p->p_ucred; - register struct msqid_ds *msqptr; - register struct msg *msghdr; + struct msqid_ds *msqptr; + struct msg *msghdr; int eval; short next; |