1 .\"
   2 .\" The contents of this file are subject to the terms of the
   3 .\" Common Development and Distribution License (the "License").
   4 .\" You may not use this file except in compliance with the License.
   5 .\"
   6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   7 .\" or http://www.opensolaris.org/os/licensing.
   8 .\" See the License for the specific language governing permissions
   9 .\" and limitations under the License.
  10 .\"
  11 .\" When distributing Covered Code, include this CDDL HEADER in each
  12 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  13 .\" If applicable, add the following below this CDDL HEADER, with the
  14 .\" fields enclosed by brackets "[]" replaced with your own identifying
  15 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  16 .\"
  17 .\"
  18 .\" Copyright 1989 AT&T
  19 .\" Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved.
  20 .\" Copyright 2018 Nexenta Systems, Inc.
  21 .\"
  22 .Dd August 2, 2018
  23 .Dt SHUTDOWN 3C
  24 .Os
  25 .Sh NAME
  26 .Nm shutdown
  27 .Nd shut down part of a full-duplex connection
  28 .Sh LIBRARY
  29 .Lb libc
  30 .Sh SYNOPSIS
  31 .In sys/socket.h
  32 .Ft int
  33 .Fo shutdown
  34 .Fa "int s"
  35 .Fa "int how"
  36 .Fc
  37 .Sh DESCRIPTION
  38 The
  39 .Fn shutdown
  40 call shuts down all or part of a full-duplex connection on the socket associated
  41 with
  42 .Fa s .
  43 If
  44 .Fa how
  45 is
  46 .Dv SHUT_RD ,
  47 further receives are disallowed.
  48 If
  49 .Fa how
  50 is
  51 .Dv SHUT_WR ,
  52 further sends are disallowed.
  53 If
  54 .Fa how
  55 is
  56 .Dv SHUT_RDWR ,
  57 further sends and receives are disallowed.
  58 .Pp
  59 The
  60 .Fa how
  61 values should be defined constants.
  62 .Sh RETURN VALUES
  63 0 is returned if the call succeeds.
  64 -1 is returned if the call fails.
  65 .Sh ERRORS
  66 The call succeeds unless one of the following conditions exists:
  67 .Bl -tag -width Er
  68 .It Bq Er EBADF
  69 The
  70 .Fa s
  71 value is not a valid file descriptor.
  72 .It Bq Er ENOMEM
  73 Insufficient user memory is available for the operation to complete.
  74 .It Bq Er ENOSR
  75 Insufficient STREAMS resources are available for the operation to complete.
  76 .It Bq Er ENOTCONN
  77 The specified socket is not connected.
  78 .It Bq Er ENOTSOCK
  79 The
  80 .Fa s
  81 value is not a socket.
  82 .El
  83 .Sh MT-LEVEL
  84 .Sy Safe
  85 .Sh SEE ALSO
  86 .Xr connect 3C ,
  87 .Xr socket 3C ,
  88 .Xr socket.h 3HEAD ,
  89 .Xr attributes 5