1 .\" Copyright (c) 2007 Bruce M. Simpson.
2 .\" Copyright (c) 1983, 1991, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" @(#)shutdown.2 8.1 (Berkeley) 6/4/93
37 .Nd disable sends and/or receives on a socket
44 .Fn shutdown "int s" "int how"
48 system call disables sends or receives on a socket.
51 argument specifies the type of shutdown.
53 .Bl -tag -width ".Dv SHUT_RDWR"
55 Further receives will be disallowed.
57 Further sends will be disallowed.
58 This may cause actions specific to the protocol family of the socket
61 .Sx IMPLEMENTATION NOTES .
63 Further sends and receives will be disallowed.
68 If the file descriptor
72 socket, all or part of the full-duplex connection will be shut down.
74 .Sh IMPLEMENTATION NOTES
75 The following protocol specific actions apply to the use of
79 based on the properties of the socket associated with the file descriptor
81 .Bl -column ".Dv PF_INET6" ".Dv SOCK_STREAM" ".Dv IPPROTO_SCTP"
82 .It Sy Domain Ta Sy Type Ta Sy Protocol Ta Sy Action
83 .It Dv PF_INET Ta Dv SOCK_DGRAM Ta Dv IPPROTO_SCTP Ta
85 as socket is not connected.
86 .It Dv PF_INET Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
88 as socket is not connected.
89 .It Dv PF_INET Ta Dv SOCK_STREAM Ta Dv IPPROTO_SCTP Ta
90 Send queued data and tear down association.
91 .It Dv PF_INET Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
92 Send queued data, wait for ACK, then send FIN.
93 .It Dv PF_INET6 Ta Dv SOCK_DGRAM Ta Dv IPPROTO_SCTP Ta
95 as socket is not connected.
96 .It Dv PF_INET6 Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
98 as socket is not connected.
99 .It Dv PF_INET6 Ta Dv SOCK_STREAM Ta Dv IPPROTO_SCTP Ta
100 Send queued data and tear down association.
101 .It Dv PF_INET6 Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
102 Send queued data, wait for ACK, then send FIN.
110 system call fails if:
115 argument is not a valid file descriptor.
123 argument specifies a socket which is not connected.
127 argument does not refer to a socket.
137 system call is expected to comply with
143 system call appeared in
146 .Dv SHUT_RD , SHUT_WR ,
149 constants appeared in
153 This manual page was updated by
154 .An Bruce M. Simpson Aq Mt bms@FreeBSD.org
164 .Dq Li "port unreachable"
165 message should be generated in response to
166 datagrams received on a local port to which