#define SHUT_RD 0b01 #define SHUT_RDWR 0b10 #define SHUT_WR 0b11 int shutdown(int sockfd, int how);
This syscall stops transmission or reception for a socket from a peer.
how signals how to stop communication, it can be the following values:
SHUT_RDFurther receiving will not be allowed.
SHUT_WRFurther transmitting will not be allowed.
SHUT_RDWRFurther receiving and transmitting will not be allowed.
The syscall returns 0 on success or -1 on failure, with the
following errno:
EINVALThe passed FD was a non bound socket.
EBADFThe passed file is valid but it was not a physical file in a filesystem.