|SHUT_RD||Further receives will be disallowed.|
|SHUT_WR||Further sends will be disallowed. This may cause actions specific to the protocol family of the socket s to happen; see IMPLEMENTATION NOTES.|
|Further sends and receives will be disallowed. Implies SHUT_WR.|
If the file descriptor s is associated with a 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.
Domain Type Protocol Return value and action
PF_INET SOCK_DGRAM IPPROTO_SCTP
Return -1. The global variable errno will be set to EOPNOTSUPP. PF_INET SOCK_DGRAM IPPROTO_UDP Return 0. ICMP messages will not be generated. PF_INET SOCK_STREAM IPPROTO_SCTP Return 0. Send queued data and tear down association. PF_INET SOCK_STREAM IPPROTO_TCP Return 0. Send queued data, wait for ACK, then send FIN. PF_INET6 SOCK_DGRAM IPPROTO_SCTP Return -1. The global variable errno will be set to EOPNOTSUPP. PF_INET6 SOCK_DGRAM IPPROTO_UDP Return 0. ICMP messages will not be generated. PF_INET6 SOCK_STREAM IPPROTO_SCTP Return 0. Send queued data and tear down association. PF_INET6 SOCK_STREAM IPPROTO_TCP Return 0. Send queued data, wait for ACK, then send FIN.
.Rv -std shutdown
The shutdown system call fails if:
[EBADF] The s argument is not a valid file descriptor. [EINVAL] The how argument is invalid. [EOPNOTSUPP] The socket associated with the file descriptor s does not support this operation. [ENOTCONN] The s argument specifies a SOCK_STREAM socket which is not connected. [ENOTSOCK] The s argument does not refer to a socket.
The shutdown system call is expected to comply with -p1003.1g-2000, when finalized.
The shutdown system call appeared in BSD 4.2 . The SHUT_RD, SHUT_WR, and SHUT_RDWR constants appeared in -p1003.1g-2000.
.An -nosplit This manual page was updated by
.An Bruce M. Simpson Aq bms@FreeBSD.org to reflect how shutdown behaves with PF_INET and PF_INET6 sockets.
The ICMP "port unreachable" message should be generated in response to datagrams received on a local port to which s is bound after shutdown is called.