1 '\" te
   2 .\"  Copyright 1989 AT&T  Copyright (c) 2005,
   3 .\" Sun Microsystems, Inc.  All Rights Reserved
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH SHUTDOWN 3SOCKET "Jan 31, 2005"
   8 .SH NAME
   9 shutdown \- shut down part of a full-duplex connection
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR [ \fIlibrary\fR... ]
  14 #include <sys/socket.h>
  15 
  16 \fBint\fR \fBshutdown\fR(\fBint\fR \fIs\fR, \fBint\fR \fIhow\fR);
  17 .fi
  18 
  19 .SH DESCRIPTION
  20 .sp
  21 .LP
  22 The \fBshutdown()\fR call shuts down all or part of a full-duplex connection on
  23 the socket associated with \fIs\fR. If \fIhow\fR is \fBSHUT_RD\fR, further
  24 receives are disallowed. If \fIhow\fR is \fBSHUT_WR\fR, further sends are
  25 disallowed. If \fIhow\fR is \fBSHUT_RDWR\fR, further sends and receives are
  26 disallowed.
  27 .sp
  28 .LP
  29 The \fIhow\fR values should be defined constants.
  30 .SH RETURN VALUES
  31 .sp
  32 .LP
  33 \fB0\fR is returned if the call succeeds.
  34 .sp
  35 .LP
  36 \fB\(mi1\fR is returned if the call fails.
  37 .SH ERRORS
  38 .sp
  39 .LP
  40 The call succeeds unless one of the following conditions exists:
  41 .sp
  42 .ne 2
  43 .na
  44 \fB\fBEBADF\fR\fR
  45 .ad
  46 .RS 12n
  47 The \fIs\fR value is not a valid file descriptor.
  48 .RE
  49 
  50 .sp
  51 .ne 2
  52 .na
  53 \fB\fBENOMEM\fR\fR
  54 .ad
  55 .RS 12n
  56 Insufficient user memory is available for the operation to complete.
  57 .RE
  58 
  59 .sp
  60 .ne 2
  61 .na
  62 \fB\fBENOSR\fR\fR
  63 .ad
  64 .RS 12n
  65 Insufficient \fBSTREAMS\fR resources are available for the operation to
  66 complete.
  67 .RE
  68 
  69 .sp
  70 .ne 2
  71 .na
  72 \fB\fBENOTCONN\fR\fR
  73 .ad
  74 .RS 12n
  75 The specified socket is not connected.
  76 .RE
  77 
  78 .sp
  79 .ne 2
  80 .na
  81 \fB\fBENOTSOCK\fR\fR
  82 .ad
  83 .RS 12n
  84 The \fIs\fR value is not a socket.
  85 .RE
  86 
  87 .SH ATTRIBUTES
  88 .sp
  89 .LP
  90 See \fBattributes\fR(5) for descriptions of the following attributes:
  91 .sp
  92 
  93 .sp
  94 .TS
  95 box;
  96 c | c
  97 l | l .
  98 ATTRIBUTE TYPE  ATTRIBUTE VALUE
  99 _
 100 MT-Level        Safe
 101 .TE
 102 
 103 .SH SEE ALSO
 104 .sp
 105 .LP
 106 \fBconnect\fR(3SOCKET), \fBsocket\fR(3SOCKET), \fBsocket.h\fR(3HEAD),
 107 \fBattributes\fR(5)