logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

shutdown.3p (3212B)


  1. '\" et
  2. .TH SHUTDOWN "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. shutdown
  12. \(em shut down socket send and receive operations
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/socket.h>
  17. .P
  18. int shutdown(int \fIsocket\fP, int \fIhow\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIshutdown\fR()
  23. function shall cause all or part of a full-duplex connection on the
  24. socket associated with the file descriptor
  25. .IR socket
  26. to be shut down.
  27. .P
  28. The
  29. \fIshutdown\fR()
  30. function takes the following arguments:
  31. .IP "\fIsocket\fR" 12
  32. Specifies the file descriptor of the socket.
  33. .IP "\fIhow\fR" 12
  34. Specifies the type of shutdown. The values are as follows:
  35. .RS 12
  36. .IP SHUT_RD 12
  37. Disables further receive operations.
  38. .IP SHUT_WR 12
  39. Disables further send operations.
  40. .IP SHUT_RDWR 12
  41. Disables further send and receive operations.
  42. .RE
  43. .P
  44. The
  45. \fIshutdown\fR()
  46. function disables subsequent send and/or receive operations on a
  47. socket, depending on the value of the
  48. .IR how
  49. argument.
  50. .SH "RETURN VALUE"
  51. Upon successful completion,
  52. \fIshutdown\fR()
  53. shall return 0; otherwise, \-1 shall be returned and
  54. .IR errno
  55. set to indicate the error.
  56. .SH ERRORS
  57. The
  58. \fIshutdown\fR()
  59. function shall fail if:
  60. .TP
  61. .BR EBADF
  62. The
  63. .IR socket
  64. argument is not a valid file descriptor.
  65. .TP
  66. .BR EINVAL
  67. The
  68. .IR how
  69. argument is invalid.
  70. .TP
  71. .BR ENOTCONN
  72. The socket is not connected.
  73. .TP
  74. .BR ENOTSOCK
  75. The
  76. .IR socket
  77. argument does not refer to a socket.
  78. .P
  79. The
  80. \fIshutdown\fR()
  81. function may fail if:
  82. .TP
  83. .BR ENOBUFS
  84. Insufficient resources were available in the system to perform the
  85. operation.
  86. .LP
  87. .IR "The following sections are informative."
  88. .SH "EXAMPLES"
  89. None.
  90. .SH "APPLICATION USAGE"
  91. None.
  92. .SH "RATIONALE"
  93. None.
  94. .SH "FUTURE DIRECTIONS"
  95. None.
  96. .SH "SEE ALSO"
  97. .IR "\fIgetsockopt\fR\^(\|)",
  98. .IR "\fIpselect\fR\^(\|)",
  99. .IR "\fIread\fR\^(\|)",
  100. .IR "\fIrecv\fR\^(\|)",
  101. .IR "\fIrecvfrom\fR\^(\|)",
  102. .IR "\fIrecvmsg\fR\^(\|)",
  103. .IR "\fIsend\fR\^(\|)",
  104. .IR "\fIsendto\fR\^(\|)",
  105. .IR "\fIsetsockopt\fR\^(\|)",
  106. .IR "\fIsocket\fR\^(\|)",
  107. .IR "\fIwrite\fR\^(\|)"
  108. .P
  109. The Base Definitions volume of POSIX.1\(hy2017,
  110. .IR "\fB<sys_socket.h>\fP"
  111. .\"
  112. .SH COPYRIGHT
  113. Portions of this text are reprinted and reproduced in electronic form
  114. from IEEE Std 1003.1-2017, Standard for Information Technology
  115. -- Portable Operating System Interface (POSIX), The Open Group Base
  116. Specifications Issue 7, 2018 Edition,
  117. Copyright (C) 2018 by the Institute of
  118. Electrical and Electronics Engineers, Inc and The Open Group.
  119. In the event of any discrepancy between this version and the original IEEE and
  120. The Open Group Standard, the original IEEE and The Open Group Standard
  121. is the referee document. The original Standard can be obtained online at
  122. http://www.opengroup.org/unix/online.html .
  123. .PP
  124. Any typographical or formatting errors that appear
  125. in this page are most likely
  126. to have been introduced during the conversion of the source files to
  127. man page format. To report such errors, see
  128. https://www.kernel.org/doc/man-pages/reporting_bugs.html .