Shuts down all socket send and receive operations.
Standard C Library (libc.a)
The shutdown subroutine disables all receive and send operations on the specified socket.
All applications containing the shutdown subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
| Item | Description |
|---|---|
| Socket | Specifies the unique name of the socket. |
| How | Specifies the type of subroutine shutdown. Use the following
values:
|
Upon successful completion, a value of 0 is returned.
If the shutdown subroutine is unsuccessful, the subroutine handler performs the following functions:
The shutdown subroutine is unsuccessful if any of the following errors occurs:
| Error | Description |
|---|---|
| EBADF | The Socket parameter is not valid. |
| EINVAL | The How parameter is invalid. |
| ENOTCONN | The socket is not connected. |
| ENOTSOCK | The Socket parameter refers to a file, not a socket. |
| Item | Description |
|---|---|
| /usr/include/sys/socket.h | Contains socket definitions. |
| /usr/include/sys/types.h | Contains definitions of unsigned data types. |