summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2018-08-20 16:00:22 +0000
committermpi <mpi@openbsd.org>2018-08-20 16:00:22 +0000
commit2bd648c0c791046970147cb6db731832ad511740 (patch)
tree9513fd3a61c273d992777348c936600acb660044 /sys/kern/sys_socket.c
parentRemove unused spllock(). (diff)
downloadwireguard-openbsd-2bd648c0c791046970147cb6db731832ad511740.tar.xz
wireguard-openbsd-2bd648c0c791046970147cb6db731832ad511740.zip
Reorder checks in the read/write(2) family of syscalls to prepare making
file operations mp-safe. This change makes it clear that `f_offset' is only accessed in vn_read() and vn_write(), which will help taking it out of the KERNEL_LOCK(). This refactoring uncovered a race in vn_read() which is now documented and will be addressed in a later diff. ok visa@
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 57a24d8f67d..22b3e266654 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_socket.c,v 1.40 2018/07/30 12:22:14 mpi Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.41 2018/08/20 16:00:22 mpi Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
@@ -59,7 +59,7 @@ struct fileops socketops = {
};
int
-soo_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred)
+soo_read(struct file *fp, struct uio *uio, int fflags)
{
struct socket *so = (struct socket *)fp->f_data;
int flags = 0;
@@ -71,7 +71,7 @@ soo_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred)
}
int
-soo_write(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred)
+soo_write(struct file *fp, struct uio *uio, int fflags)
{
struct socket *so = (struct socket *)fp->f_data;
int flags = 0;