diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sys_generic.c | 10 | ||||
-rw-r--r-- | sys/kern/sys_pipe.c | 12 | ||||
-rw-r--r-- | sys/kern/sys_socket.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 35 |
4 files changed, 40 insertions, 25 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 012a51a9580..c0a860abd60 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.22 1999/11/29 22:02:14 deraadt Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.23 2000/04/19 08:34:54 csapuntz Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -114,7 +114,7 @@ sys_read(p, v, retval) ktriov = aiov; #endif cnt = SCARG(uap, nbyte); - error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred); + error = (*fp->f_ops->fo_read)(fp, &fp->f_offset, &auio, fp->f_cred); if (error) if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -199,7 +199,7 @@ sys_readv(p, v, retval) } #endif cnt = auio.uio_resid; - error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred); + error = (*fp->f_ops->fo_read)(fp, &fp->f_offset, &auio, fp->f_cred); if (error) if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -266,7 +266,7 @@ sys_write(p, v, retval) ktriov = aiov; #endif cnt = SCARG(uap, nbyte); - error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred); + error = (*fp->f_ops->fo_write)(fp, &fp->f_offset, &auio, fp->f_cred); if (error) { if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -354,7 +354,7 @@ sys_writev(p, v, retval) } #endif cnt = auio.uio_resid; - error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred); + error = (*fp->f_ops->fo_write)(fp, &fp->f_offset, &auio, fp->f_cred); if (error) { if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 431e1d29170..497d716288b 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.23 2000/01/27 18:56:13 art Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.24 2000/04/19 08:34:54 csapuntz Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -62,8 +62,8 @@ /* * interfaces to the outside world */ -int pipe_read __P((struct file *, struct uio *, struct ucred *)); -int pipe_write __P((struct file *, struct uio *, struct ucred *)); +int pipe_read __P((struct file *, off_t *, struct uio *, struct ucred *)); +int pipe_write __P((struct file *, off_t *, struct uio *, struct ucred *)); int pipe_close __P((struct file *, struct proc *)); int pipe_select __P((struct file *, int which, struct proc *)); int pipe_ioctl __P((struct file *, u_long, caddr_t, struct proc *)); @@ -264,8 +264,9 @@ pipeselwakeup(cpipe) /* ARGSUSED */ int -pipe_read(fp, uio, cred) +pipe_read(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { @@ -390,8 +391,9 @@ pipe_read(fp, uio, cred) } int -pipe_write(fp, uio, cred) +pipe_write(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index f25e4b5d445..f385310036a 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.3 1997/08/31 20:42:23 deraadt Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.4 2000/04/19 08:34:53 csapuntz Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -55,8 +55,9 @@ struct fileops socketops = /* ARGSUSED */ int -soo_read(fp, uio, cred) +soo_read(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { @@ -67,8 +68,9 @@ soo_read(fp, uio, cred) /* ARGSUSED */ int -soo_write(fp, uio, cred) +soo_write(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 72cd75fa60e..e6ca0a79df3 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_vnops.c,v 1.23 1999/11/13 03:48:09 angelos Exp $ */ +/* $OpenBSD: vfs_vnops.c,v 1.24 2000/04/19 08:34:53 csapuntz Exp $ */ /* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */ /* @@ -61,6 +61,15 @@ #include <uvm/uvm_extern.h> #endif +int vn_read __P((struct file *fp, off_t *off, struct uio *uio, + struct ucred *cred)); +int vn_write __P((struct file *fp, off_t *off, struct uio *uio, + struct ucred *cred)); +int vn_select __P((struct file *fp, int which, struct proc *p)); +int vn_closefile __P((struct file *fp, struct proc *p)); +int vn_ioctl __P((struct file *fp, u_long com, caddr_t data, + struct proc *p)); + struct fileops vnops = { vn_read, vn_write, vn_ioctl, vn_select, vn_closefile }; @@ -275,8 +284,9 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, p) * File table vnode read routine. */ int -vn_read(fp, uio, cred) +vn_read(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { @@ -287,12 +297,12 @@ vn_read(fp, uio, cred) VOP_LEASE(vp, uio->uio_procp, cred, LEASE_READ); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - uio->uio_offset = fp->f_offset; + uio->uio_offset = *poff; count = uio->uio_resid; if (vp->v_type != VDIR) error = VOP_READ(vp, uio, (fp->f_flag & FNONBLOCK) ? IO_NDELAY : 0, cred); - fp->f_offset += count - uio->uio_resid; + *poff += count - uio->uio_resid; VOP_UNLOCK(vp, 0, p); return (error); } @@ -301,8 +311,9 @@ vn_read(fp, uio, cred) * File table vnode write routine. */ int -vn_write(fp, uio, cred) +vn_write(fp, poff, uio, cred) struct file *fp; + off_t *poff; struct uio *uio; struct ucred *cred; { @@ -320,13 +331,13 @@ vn_write(fp, uio, cred) ioflag |= IO_SYNC; VOP_LEASE(vp, uio->uio_procp, cred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - uio->uio_offset = fp->f_offset; + uio->uio_offset = *poff; count = uio->uio_resid; error = VOP_WRITE(vp, uio, ioflag, cred); if (ioflag & IO_APPEND) - fp->f_offset = uio->uio_offset; + *poff = uio->uio_offset; else - fp->f_offset += count - uio->uio_resid; + *poff += count - uio->uio_resid; VOP_UNLOCK(vp, 0, p); return (error); } @@ -422,13 +433,13 @@ vn_ioctl(fp, com, data, p) if (com == FIBMAP) return VOP_IOCTL(vp, com, data, fp->f_flag, p->p_ucred, p); - if (com == FIONBIO || com == FIOASYNC) /* XXX */ - return (0); /* XXX */ - /* fall into ... */ + if (com == FIONBIO || com == FIOASYNC) /* XXX */ + return (0); /* XXX */ + /* fall into... */ default: return (ENOTTY); - + case VFIFO: case VCHR: case VBLK: |