'\"macro stdmacro
.if n .pH g3n.shutdown @(#)shutdown	40.6 of 1/29/90
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} shutdown 3N "" "\&"
.if \nX=1 .ds x} shutdown 3N ""
.if \nX=2 .ds x} shutdown 3N "" "\&"
.if \nX=3 .ds x} shutdown "" "" "\&"
.TH \*(x}
.SH NAME
\f4shutdown\fP \- shut down part of a full-duplex connection
.SH SYNOPSIS
.nf
.ft CW
shutdown(s, how)
int s, how;
.fi
.SH DESCRIPTION
.LP
The \f4shutdown(\|)\f1
call shuts down all or part of a full-duplex
connection on the socket associated with
.IR s .
If
.I how
is \f40\fP, then further receives will be disallowed.
If
.I how
is \f41\fP, then further sends will be disallowed.
If
.I how
is \f42\fP, then further sends and receives will be disallowed.
.SH RETURN VALUE
.LP
A \f40\fP is returned if the call succeeds, \f4-1\fP if it fails.
.SH ERRORS
.LP
The call succeeds unless:
.TP 20
\f4EBADF\f1
.I s
is not a valid descriptor.
.TP
\f4ENOTSOCK\f1
.I s
is a file, not a socket.
.TP
\f4ENOTCONN\f1
The specified socket is not connected.
.TP
\f4ENOMEM\f1
There was insufficient user memory available for the operation to
complete.
.TP
\f4ENOSR\f1
There were insufficient
.SM STREAMS
resources available for the operation to
complete.
.SH "SEE ALSO"
\f4connect\f1(3N),
\f4socket\f1(3N).
.SH NOTES
.LP
The
.I how
values should be defined constants.
