man.bsd.lv manual page server

Manual Page Search Parameters

SHUTDOWN(2) System Calls Manual SHUTDOWN(2)

shutdownshut down part of a full-duplex connection

library “libc”

#include <sys/types.h>
#include <sys/socket.h>

int
shutdown(int s, int how);

The () call causes all or part of a full-duplex connection on the socket associated with the file descriptor s to be shut down. The how argument specifies the type of shutdown. Possible values are:
further receives will be disallowed.
further sends will be disallowed.
further sends and receives will be disallowed.

The 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.

The shutdown() call fails if:

[]
The s argument is not a valid file descriptor.
[]
The how argument is invalid.
[]
The socket is not connected.
[]
The s argument does not refer to a socket.

connect(2), socket(2)

The shutdown() function is expected to comply with IEEE Std 1003.1g-2000 (“POSIX.1g”), when finalized.

The shutdown() function call appeared in 4.2BSD. The SHUT_RD, SHUT_WR, and SHUT_RDWR constants appeared in IEEE Std 1003.1g-2000 (“POSIX.1g”).

February 27, 2001 DragonFly-5.6.1