1SHUTDOWN(2)                Linux Programmer's Manual               SHUTDOWN(2)
2
3
4

NAME

6       shutdown - shut down part of a full-duplex connection
7

SYNOPSIS

9       #include <sys/socket.h>
10
11       int shutdown(int sockfd, int how);
12

DESCRIPTION

14       The  shutdown()  call causes all or part of a full-duplex connection on
15       the socket associated with sockfd to be shut down.  If how is  SHUT_RD,
16       further  receptions  will  be  disallowed.   If how is SHUT_WR, further
17       transmissions will be disallowed.  If how is SHUT_RDWR, further  recep‐
18       tions and transmissions will be disallowed.
19

RETURN VALUE

21       On  success,  zero is returned.  On error, -1 is returned, and errno is
22       set appropriately.
23

ERRORS

25       EBADF  sockfd is not a valid descriptor.
26
27       ENOTCONN
28              The specified socket is not connected.
29
30       ENOTSOCK
31              sockfd is a file, not a socket.
32

CONFORMING TO

34       POSIX.1-2001, 4.4BSD (the shutdown() function call  first  appeared  in
35       4.2BSD).
36

NOTES

38       The  constants  SHUT_RD,  SHUT_WR,  SHUT_RDWR  have  the value 0, 1, 2,
39       respectively, and are defined in <sys/socket.h> since glibc-2.1.91.
40

SEE ALSO

42       connect(2), socket(2), socket(7)
43

COLOPHON

45       This page is part of release 3.25 of the Linux  man-pages  project.   A
46       description  of  the project, and information about reporting bugs, can
47       be found at http://www.kernel.org/doc/man-pages/.
48
49
50
51Linux                             2008-12-03                       SHUTDOWN(2)
Impressum