1shutdown(3XNET)  X/Open Networking Services Library Functions  shutdown(3XNET)
2
3
4

NAME

6       shutdown - shut down socket send and receive operations
7

SYNOPSIS

9       cc [ flag ... ] file ... -lxnet [ library ... ]
10       #include <sys/socket.h>
11
12       int shutdown(int socket, int how);
13
14

DESCRIPTION

16       The shutdown() function disables subsequent send() and receive() opera‐
17       tions on a socket, depending on the value of the how argument.
18

PARAMETERS

20       how       Specifies the type of shutdown.  The values are as follows:
21
22                 SHUT_RD      Disables further receive operations.
23
24
25                 SHUT_WR      Disables further send operations.
26
27
28                 SHUT_RDWR    Disables further send and receive operations.
29
30
31
32       socket    Specifies the file descriptor of the socket.
33
34

RETURN VALUES

36       Upon successful completion, shutdown() returns  0.   Otherwise,  −1  is
37       returned and errno is set to indicate the error.
38

ERRORS

40       The shutdown() function will fail if:
41
42       EBADF       The socket argument is not a valid file descriptor.
43
44
45       EINVAL      The how argument is invalid.
46
47
48       ENOTCONN    The socket is not connected.
49
50
51       ENOTSOCK    The socket argument does not refer to a socket.
52
53
54
55       The shutdown() function may fail if:
56
57       ENOBUFS    Insufficient  resources were available in the system to per‐
58                  form the operation.
59
60
61       ENOSR      There were insufficient STREAMS resources available for  the
62                  operation to complete.
63
64

ATTRIBUTES

66       See attributes(5) for descriptions of the following attributes:
67
68
69
70
71       ┌─────────────────────────────┬─────────────────────────────┐
72       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
73       ├─────────────────────────────┼─────────────────────────────┤
74       │Interface Stability          │Standard                     │
75       ├─────────────────────────────┼─────────────────────────────┤
76       │MT-Level                     │MT-Safe                      │
77       └─────────────────────────────┴─────────────────────────────┘
78

SEE ALSO

80       getsockopt(3XNET),    recv(3XNET),   recvfrom(3XNET),   recvmsg(3XNET),
81       select(3C),     send(3XNET),     sendto(3XNET),      setsockopt(3XNET),
82       socket(3XNET), attributes(5), standards(5)
83
84
85
86SunOS 5.11                        10 Jun 2002                  shutdown(3XNET)
Impressum