man page macro and text revisions (-mdoc version 3)
[unix-history] / usr / src / lib / libc / sys / shutdown.2
CommitLineData
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 19The
931b8415 20.Fn shutdown
6078a027
KM
21call causes all or part of a full-duplex connection on
22the socket associated with
931b8415 23.Fa s
6078a027 24to be shut down.
931b8415
CL
25If
26.Fa how
27is 0, further receives will be disallowed.
28If
29.Fa how
30is 1, further sends will be disallowed.
31If
32.Fa how
33is 2, further sends and receives will be disallowed.
34.Sh DIAGNOSTICS
35A 0 is returned if the call succeeds, -1 if it fails.
36.Sh ERRORS
6078a027 37The call succeeds unless:
931b8415
CL
38.Bl -tag -width ENOTCONNAA
39.It Bq Er EBADF
40.Fa S
6078a027 41is not a valid descriptor.
931b8415
CL
42.It Bq Er ENOTSOCK
43.Fa S
6078a027 44is a file, not a socket.
931b8415 45.It Bq Er ENOTCONN
6078a027 46The specified socket is not connected.
931b8415
CL
47.El
48.Sh SEE ALSO
49.Xr connect 2 ,
50.Xr socket 2
51.Sh HISTORY
52The
53.Nm
54function call appeared in
55.Bx 4.2 .