1SHUTDOWN(3P)               POSIX Programmer's Manual              SHUTDOWN(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       shutdown - shut down socket send and receive operations
13

SYNOPSIS

15       #include <sys/socket.h>
16
17       int shutdown(int socket, int how);
18
19

DESCRIPTION

21       The shutdown() function shall cause all or part of a  full-duplex  con‐
22       nection  on the socket associated with the file descriptor socket to be
23       shut down.
24
25       The shutdown() function takes the following arguments:
26
27       socket Specifies the file descriptor of the socket.
28
29       how    Specifies the type of shutdown. The values are as follows:
30
31       SHUT_RD
32              Disables further receive operations.
33
34       SHUT_WR
35              Disables further send operations.
36
37       SHUT_RDWR
38              Disables further send and receive operations.
39
40
41
42       The shutdown() function disables subsequent send and/or receive  opera‐
43       tions on a socket, depending on the value of the how argument.
44

RETURN VALUE

46       Upon  successful  completion,  shutdown() shall return 0; otherwise, -1
47       shall be returned and errno set to indicate the error.
48

ERRORS

50       The shutdown() function shall fail if:
51
52       EBADF  The socket argument is not a valid file descriptor.
53
54       EINVAL The how argument is invalid.
55
56       ENOTCONN
57              The socket is not connected.
58
59       ENOTSOCK
60              The socket argument does not refer to a socket.
61
62
63       The shutdown() function may fail if:
64
65       ENOBUFS
66              Insufficient resources were available in the system  to  perform
67              the operation.
68
69
70       The following sections are informative.
71

EXAMPLES

73       None.
74

APPLICATION USAGE

76       None.
77

RATIONALE

79       None.
80

FUTURE DIRECTIONS

82       None.
83

SEE ALSO

85       getsockopt(),  read(), recv(), recvfrom(), recvmsg(), select(), send(),
86       sendto(), setsockopt(), socket(), write(), the Base Definitions  volume
87       of IEEE Std 1003.1-2001, <sys/socket.h>
88
90       Portions  of  this text are reprinted and reproduced in electronic form
91       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
92       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
93       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
94       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
95       event of any discrepancy between this version and the original IEEE and
96       The  Open Group Standard, the original IEEE and The Open Group Standard
97       is the referee document. The original Standard can be  obtained  online
98       at http://www.opengroup.org/unix/online.html .
99
100
101
102IEEE/The Open Group                  2003                         SHUTDOWN(3P)
Impressum