1 .\" $OpenBSD: shutdown.2,v 1.15 2014/09/09 09:00:17 guenther Exp $
2 .\" $NetBSD: shutdown.2,v 1.5 1995/02/27 12:37:11 cgd Exp $
4 .\" Copyright (c) 1983, 1991, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" @(#)shutdown.2 8.1 (Berkeley) 6/4/93
38 .Nd disable sends or receives on a socket
42 .Fn shutdown "int s" "int how"
46 system call disables sends or receives on a socket.
48 If the file descriptor
52 socket, all or part of the full-duplex connection will be shut down.
56 argument specifies the type of shutdown.
58 .Bl -tag -width "SHUT_RDWRXXX" -offset indent
60 Further receives will be disallowed.
62 Further sends will be disallowed.
63 This may cause actions specific to the protocol family of the socket
67 Further sends and receives will be disallowed.
70 The following protocol specific actions apply to the use of
72 based on the properties of the socket associated with the file descriptor
74 .Bl -column "AF_INET6" "SOCK_STREAM" "IPPROTO_UDP" -offset indent
75 .It DOMAIN Ta TYPE Ta PROTOCOL Ta "RETURN VALUE AND ACTION"
77 .It Dv AF_INET Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
82 .It Dv AF_INET Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
84 Send queued data, wait for ACK, then send FIN.
85 .It Dv AF_INET6 Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
90 .It Dv AF_INET6 Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
92 Send queued data, wait for ACK, then send FIN.
104 argument is not a valid file descriptor.
114 socket which is not connected.
118 argument does not refer to a socket.
120 The socket associated with the file descriptor
122 does not support this operation.
137 system call first appeared in
140 .Dv SHUT_RD , SHUT_WR ,
143 constants appeared in