Commit | Line | Data |
---|---|---|
931b8415 | 1 | .\" Copyright (c) 1983, 1991 The Regents of the University of California. |
88b3ccf2 | 2 | .\" All rights reserved. |
6078a027 | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
88b3ccf2 | 5 | .\" |
931b8415 | 6 | .\" @(#)shutdown.2 6.4 (Berkeley) %G% |
6078a027 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt SHUTDOWN 2 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm shutdown | |
13 | .Nd shut down part of a full-duplex connection | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/socket.h> | |
16 | .Ft int | |
17 | .Fn shutdown "int s" "int how" | |
18 | .Sh DESCRIPTION | |
6078a027 | 19 | The |
931b8415 | 20 | .Fn shutdown |
6078a027 KM |
21 | call causes all or part of a full-duplex connection on |
22 | the socket associated with | |
931b8415 | 23 | .Fa s |
6078a027 | 24 | to be shut down. |
931b8415 CL |
25 | If |
26 | .Fa how | |
27 | is 0, further receives will be disallowed. | |
28 | If | |
29 | .Fa how | |
30 | is 1, further sends will be disallowed. | |
31 | If | |
32 | .Fa how | |
33 | is 2, further sends and receives will be disallowed. | |
34 | .Sh DIAGNOSTICS | |
35 | A 0 is returned if the call succeeds, -1 if it fails. | |
36 | .Sh ERRORS | |
6078a027 | 37 | The call succeeds unless: |
931b8415 CL |
38 | .Bl -tag -width ENOTCONNAA |
39 | .It Bq Er EBADF | |
40 | .Fa S | |
6078a027 | 41 | is not a valid descriptor. |
931b8415 CL |
42 | .It Bq Er ENOTSOCK |
43 | .Fa S | |
6078a027 | 44 | is a file, not a socket. |
931b8415 | 45 | .It Bq Er ENOTCONN |
6078a027 | 46 | The specified socket is not connected. |
931b8415 CL |
47 | .El |
48 | .Sh SEE ALSO | |
49 | .Xr connect 2 , | |
50 | .Xr socket 2 | |
51 | .Sh HISTORY | |
52 | The | |
53 | .Nm | |
54 | function call appeared in | |
55 | .Bx 4.2 . |