disable sends and/or receives on a socket
Standard C Library (libc, -lc)
shutdown() system call disables sends or receives on
a socket. The how argument specifies the type of
shutdown. Possible values are:
- Further receives will be disallowed.
- Further sends will be disallowed. This may cause actions specific to the
protocol family of the socket s to happen; see
- Further sends and receives will be disallowed. Implies
If the file descriptor s is associated with
SOCK_STREAM socket, all or part of the full-duplex
connection will be shut down.
The following protocol specific actions apply to the use of
SHUT_WR (and potentially also
SHUT_RDWR), based on the properties of the socket
associated with the file descriptor s.
shutdown() function returns the value 0 if
successful; otherwise the value -1 is returned and the global variable
errno is set to indicate the error.
shutdown() system call fails if:
- The s argument is not a valid file descriptor.
- The how argument is invalid.
- The s argument specifies a socket which is not
- The s argument does not refer to a socket.
shutdown() system call is expected to comply with
IEEE Std 1003.1g-2000 (“POSIX.1g”), when
shutdown() system call appeared in
constants appeared in IEEE Std 1003.1g-2000
This manual page was updated by Bruce M. Simpson
shutdown() behaves with
The ICMP “
port unreachable” message should
be generated in response to datagrams received on a local port to which
s is bound after