shutdown(2) System Calls Manual shutdown(2) shutdown - LIBRARY Standard C library (libc, -lc) #include int shutdown(int sockfd, int how); shutdown() , sockfd. how SHUT_RD, . how SHUT_WR, . how SHUT_RDWR, . On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. EBADF sockfd . EINVAL how ( ). ENOTCONN . ENOTSOCK sockfd . POSIX.1-2008. POSIX.1-2001, 4.4BSD (first appeared in 4.2BSD). SHUT_RD, SHUT_WR, SHUT_RDWR 0, 1, 2, , glibc-2.1.91. how , , Linux 3.7 . , UNIX, . UNIX Linux 3.7. . close(2), connect(2), socket(2), socket(7) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . shutdown(2)