.\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %sccs.include.redist.man% .\" .\" @(#)shutdown.2 8.1 (Berkeley) 06/04/93 .\" .Dd .Dt SHUTDOWN 2 .Os BSD 4.2 .Sh NAME .Nm shutdown .Nd shut down part of a full-duplex connection .Sh SYNOPSIS .Fd #include .Ft int .Fn shutdown "int s" "int how" .Sh DESCRIPTION The .Fn shutdown call causes all or part of a full-duplex connection on the socket associated with .Fa s to be shut down. If .Fa how is 0, further receives will be disallowed. If .Fa how is 1, further sends will be disallowed. If .Fa how is 2, further sends and receives will be disallowed. .Sh DIAGNOSTICS A 0 is returned if the call succeeds, -1 if it fails. .Sh ERRORS The call succeeds unless: .Bl -tag -width ENOTCONNAA .It Bq Er EBADF .Fa S is not a valid descriptor. .It Bq Er ENOTSOCK .Fa S is a file, not a socket. .It Bq Er ENOTCONN The specified socket is not connected. .El .Sh SEE ALSO .Xr connect 2 , .Xr socket 2 .Sh HISTORY The .Nm function call appeared in .Bx 4.2 .