1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)shutdown.2 8.1 (Berkeley) 06/04/93 7.\" 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 19The 20.Fn shutdown 21call causes all or part of a full-duplex connection on 22the socket associated with 23.Fa s 24to be shut down. 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 37The call succeeds unless: 38.Bl -tag -width ENOTCONNAA 39.It Bq Er EBADF 40.Fa S 41is not a valid descriptor. 42.It Bq Er ENOTSOCK 43.Fa S 44is a file, not a socket. 45.It Bq Er ENOTCONN 46The specified socket is not connected. 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 . 56