summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_syscalls.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-15 13:17:36 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-15 13:17:36 +0000
commit97c8a17c7ceb3b98b9618cc5aad821417833fbdc (patch)
tree4d34fcb390a8768670f51907c58000b40da18564 /sys/nfs/nfs_syscalls.c
parent9dae951db21a82b5e9545655960de7e73c983fce (diff)
Keep socket timeout intervals in nsecs and use them with tsleep_nsec(9).
Introduce and use TIMEVAL_TO_NSEC() to convert SO_RCVTIMEO/SO_SNDTIMEO specified values into nanoseconds. As a side effect it is now possible to specify a timeout larger that (USHRT_MAX / 100) seconds. To keep code simple `so_linger' now represents a number of seconds with 0 meaning no timeout or 'infinity'. Yes, the 0 -> INFSLP API change makes conversions complicated as many timeout holders are still memset()'d. Inputs from cheloha@ and bluhm@, ok bluhm@
Diffstat (limited to 'sys/nfs/nfs_syscalls.c')
-rw-r--r--sys/nfs/nfs_syscalls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 4a5a30c13df..637ef9d6dc3 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.115 2019/12/05 10:41:57 mpi Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.116 2020/01/15 13:17:35 mpi Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -276,9 +276,9 @@ nfssvc_addsock(struct file *fp, struct mbuf *mynam)
m_freem(m);
}
so->so_rcv.sb_flags &= ~SB_NOINTR;
- so->so_rcv.sb_timeo = 0;
+ so->so_rcv.sb_timeo_nsecs = INFSLP;
so->so_snd.sb_flags &= ~SB_NOINTR;
- so->so_snd.sb_timeo = 0;
+ so->so_snd.sb_timeo_nsecs = INFSLP;
sounlock(so, s);
if (tslp)
slp = tslp;