1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" SPDX-License-Identifier: BSD-4-Clause-UC
6 .\" $Id: shutdown.2,v 1.1.1.1 1999/03/21 22:52:23 freitag Exp $
8 .\" Modified Sat Jul 24 09:57:55 1993 by Rik Faith <faith@cs.unc.edu>
9 .\" Modified Tue Oct 22 22:04:51 1996 by Eric S. Raymond <esr@thyrsus.com>
10 .\" Modified 1998 by Andi Kleen
12 .TH SHUTDOWN 2 2021-03-22 "Linux" "Linux Programmer's Manual"
14 shutdown \- shut down part of a full-duplex connection
17 .RI ( libc ", " \-lc )
20 .B #include <sys/socket.h>
22 .BI "int shutdown(int " sockfd ", int " how );
27 call causes all or part of a full-duplex connection on the socket
35 further receptions will be disallowed.
40 further transmissions will be disallowed.
45 further receptions and transmissions will be disallowed.
47 On success, zero is returned.
48 On error, \-1 is returned, and
50 is set to indicate the error.
55 is not a valid file descriptor.
58 An invalid value was specified in
63 The specified socket is not connected.
68 does not refer to a socket.
70 POSIX.1-2001, POSIX.1-2008, 4.4BSD
72 first appeared in 4.2BSD).
78 have the value 0, 1, 2,
79 respectively, and are defined in
83 Checks for the validity of
85 are done in domain-specific code,
86 and before Linux 3.7 not all domains performed these checks.
87 .\" https://bugzilla.kernel.org/show_bug.cgi?id=47111
88 Most notably, UNIX domain sockets simply ignored invalid values.
89 This problem was fixed for UNIX domain sockets
90 .\" commit fc61b928dc4d72176cf4bd4d30bf1d22e599aefc
91 .\" and for DECnet sockets in commit 46b66d7077b89fb4917ceef19b3f7dd86055c94a