...and correct my terrible spelling.diff -r1.201 -r1.202 src/sys/kern/uipc_syscalls.c
(thorpej)
--- src/sys/kern/uipc_syscalls.c 2021/10/02 17:32:55 1.201
+++ src/sys/kern/uipc_syscalls.c 2021/10/02 17:37:21 1.202
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uipc_syscalls.c,v 1.201 2021/10/02 17:32:55 thorpej Exp $ */ | 1 | /* $NetBSD: uipc_syscalls.c,v 1.202 2021/10/02 17:37:21 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Doran. | 8 | * by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -51,27 +51,27 @@ | @@ -51,27 +51,27 @@ | |||
51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
58 | * SUCH DAMAGE. | 58 | * SUCH DAMAGE. | |
59 | * | 59 | * | |
60 | * @(#)uipc_syscalls.c 8.6 (Berkeley) 2/14/95 | 60 | * @(#)uipc_syscalls.c 8.6 (Berkeley) 2/14/95 | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | #include <sys/cdefs.h> | 63 | #include <sys/cdefs.h> | |
64 | __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.201 2021/10/02 17:32:55 thorpej Exp $"); | 64 | __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.202 2021/10/02 17:37:21 thorpej Exp $"); | |
65 | 65 | |||
66 | #ifdef _KERNEL_OPT | 66 | #ifdef _KERNEL_OPT | |
67 | #include "opt_pipe.h" | 67 | #include "opt_pipe.h" | |
68 | #include "opt_sctp.h" | 68 | #include "opt_sctp.h" | |
69 | #endif | 69 | #endif | |
70 | 70 | |||
71 | #define MBUFTYPES | 71 | #define MBUFTYPES | |
72 | #include <sys/param.h> | 72 | #include <sys/param.h> | |
73 | #include <sys/systm.h> | 73 | #include <sys/systm.h> | |
74 | #include <sys/filedesc.h> | 74 | #include <sys/filedesc.h> | |
75 | #include <sys/proc.h> | 75 | #include <sys/proc.h> | |
76 | #include <sys/file.h> | 76 | #include <sys/file.h> | |
77 | #include <sys/buf.h> | 77 | #include <sys/buf.h> | |
@@ -1316,27 +1316,27 @@ pipe1(struct lwp *l, int *fildes, int fl | @@ -1316,27 +1316,27 @@ pipe1(struct lwp *l, int *fildes, int fl | |||
1316 | wf->f_flag = FWRITE | flags; | 1316 | wf->f_flag = FWRITE | flags; | |
1317 | wf->f_type = DTYPE_SOCKET; | 1317 | wf->f_type = DTYPE_SOCKET; | |
1318 | wf->f_ops = &socketops; | 1318 | wf->f_ops = &socketops; | |
1319 | wf->f_socket = wso; | 1319 | wf->f_socket = wso; | |
1320 | fildes[1] = fd; | 1320 | fildes[1] = fd; | |
1321 | solock(wso); | 1321 | solock(wso); | |
1322 | /* | 1322 | /* | |
1323 | * Pipes must be readable when there is at least 1 | 1323 | * Pipes must be readable when there is at least 1 | |
1324 | * byte of data available in the receive buffer. | 1324 | * byte of data available in the receive buffer. | |
1325 | * | 1325 | * | |
1326 | * Pipes must be writable when there is space for | 1326 | * Pipes must be writable when there is space for | |
1327 | * at least PIPE_BUF bytes in the send buffer. | 1327 | * at least PIPE_BUF bytes in the send buffer. | |
1328 | * If we're increasing the low water mark for the | 1328 | * If we're increasing the low water mark for the | |
1329 | * send buffer, then mimick how soreserve() would | 1329 | * send buffer, then mimic how soreserve() would | |
1330 | * have set the high water mark. | 1330 | * have set the high water mark. | |
1331 | */ | 1331 | */ | |
1332 | rso->so_rcv.sb_lowat = 1; | 1332 | rso->so_rcv.sb_lowat = 1; | |
1333 | if (wso->so_snd.sb_lowat < PIPE_BUF) { | 1333 | if (wso->so_snd.sb_lowat < PIPE_BUF) { | |
1334 | wso->so_snd.sb_hiwat = PIPE_BUF * 2; | 1334 | wso->so_snd.sb_hiwat = PIPE_BUF * 2; | |
1335 | } | 1335 | } | |
1336 | wso->so_snd.sb_lowat = PIPE_BUF; | 1336 | wso->so_snd.sb_lowat = PIPE_BUF; | |
1337 | error = unp_connect2(wso, rso); | 1337 | error = unp_connect2(wso, rso); | |
1338 | sounlock(wso); | 1338 | sounlock(wso); | |
1339 | if (error != 0) | 1339 | if (error != 0) | |
1340 | goto free4; | 1340 | goto free4; | |
1341 | fd_affix(p, wf, fildes[1]); | 1341 | fd_affix(p, wf, fildes[1]); | |
1342 | fd_affix(p, rf, fildes[0]); | 1342 | fd_affix(p, rf, fildes[0]); |
--- src/sys/miscfs/fifofs/fifo_vnops.c 2021/10/02 17:32:55 1.88
+++ src/sys/miscfs/fifofs/fifo_vnops.c 2021/10/02 17:37:21 1.89
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fifo_vnops.c,v 1.88 2021/10/02 17:32:55 thorpej Exp $ */ | 1 | /* $NetBSD: fifo_vnops.c,v 1.89 2021/10/02 17:37:21 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -48,27 +48,27 @@ | @@ -48,27 +48,27 @@ | |||
48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
55 | * SUCH DAMAGE. | 55 | * SUCH DAMAGE. | |
56 | * | 56 | * | |
57 | * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 | 57 | * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 | |
58 | */ | 58 | */ | |
59 | 59 | |||
60 | #include <sys/cdefs.h> | 60 | #include <sys/cdefs.h> | |
61 | __KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.88 2021/10/02 17:32:55 thorpej Exp $"); | 61 | __KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.89 2021/10/02 17:37:21 thorpej Exp $"); | |
62 | 62 | |||
63 | #include <sys/param.h> | 63 | #include <sys/param.h> | |
64 | #include <sys/systm.h> | 64 | #include <sys/systm.h> | |
65 | #include <sys/proc.h> | 65 | #include <sys/proc.h> | |
66 | #include <sys/time.h> | 66 | #include <sys/time.h> | |
67 | #include <sys/namei.h> | 67 | #include <sys/namei.h> | |
68 | #include <sys/vnode.h> | 68 | #include <sys/vnode.h> | |
69 | #include <sys/socket.h> | 69 | #include <sys/socket.h> | |
70 | #include <sys/protosw.h> | 70 | #include <sys/protosw.h> | |
71 | #include <sys/socketvar.h> | 71 | #include <sys/socketvar.h> | |
72 | #include <sys/stat.h> | 72 | #include <sys/stat.h> | |
73 | #include <sys/ioctl.h> | 73 | #include <sys/ioctl.h> | |
74 | #include <sys/file.h> | 74 | #include <sys/file.h> | |
@@ -154,27 +154,27 @@ fifo_open(void *v) | @@ -154,27 +154,27 @@ fifo_open(void *v) | |||
154 | (void)soclose(wso); | 154 | (void)soclose(wso); | |
155 | (void)soclose(rso); | 155 | (void)soclose(rso); | |
156 | kmem_free(fip, sizeof(*fip)); | 156 | kmem_free(fip, sizeof(*fip)); | |
157 | return (error); | 157 | return (error); | |
158 | } | 158 | } | |
159 | 159 | |||
160 | /* | 160 | /* | |
161 | * FIFOs must be readable when there is at least 1 | 161 | * FIFOs must be readable when there is at least 1 | |
162 | * byte of data available in the receive buffer. | 162 | * byte of data available in the receive buffer. | |
163 | * | 163 | * | |
164 | * FIFOs must be writable when there is space for | 164 | * FIFOs must be writable when there is space for | |
165 | * at least PIPE_BUF bytes in the send buffer. | 165 | * at least PIPE_BUF bytes in the send buffer. | |
166 | * If we're increasing the low water mark for the | 166 | * If we're increasing the low water mark for the | |
167 | * send buffer, then mimick how soreserve() would | 167 | * send buffer, then mimic how soreserve() would | |
168 | * have set the high water mark. | 168 | * have set the high water mark. | |
169 | */ | 169 | */ | |
170 | rso->so_rcv.sb_lowat = 1; | 170 | rso->so_rcv.sb_lowat = 1; | |
171 | if (wso->so_snd.sb_lowat < PIPE_BUF) { | 171 | if (wso->so_snd.sb_lowat < PIPE_BUF) { | |
172 | wso->so_snd.sb_hiwat = PIPE_BUF * 2; | 172 | wso->so_snd.sb_hiwat = PIPE_BUF * 2; | |
173 | } | 173 | } | |
174 | wso->so_snd.sb_lowat = PIPE_BUF; | 174 | wso->so_snd.sb_lowat = PIPE_BUF; | |
175 | 175 | |||
176 | fip->fi_readers = 0; | 176 | fip->fi_readers = 0; | |
177 | fip->fi_writers = 0; | 177 | fip->fi_writers = 0; | |
178 | wso->so_state |= SS_CANTRCVMORE; | 178 | wso->so_state |= SS_CANTRCVMORE; | |
179 | rso->so_state |= SS_CANTSENDMORE; | 179 | rso->so_state |= SS_CANTSENDMORE; | |
180 | cv_init(&fip->fi_rcv, "fiford"); | 180 | cv_init(&fip->fi_rcv, "fiford"); |