Open System Services System Calls Reference Manual (G06.25+, H06.03+)

shutdown(2) OSS System Calls Reference Manual
NAME
shutdown - Shuts down socket send and receive operations
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/socket.h>
int shutdown(
int socket,
int how
);
PARAMETERS
socket Species the le descriptor of the socket.
how Species the type of shutdown. The values are as follows:
SHUT_RD Disables further receive operations.
SHUT_RDWR
Disables further send and receive operations.
SHUT_WR Disables further send operations.
DESCRIPTION
The shutdown() function disables receive operations, send operations, or both on the specied
socket.
RETURN VALUES
Upon successful completion, the shutdown() function returns the value 0 (zero). Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the shutdown( ) function sets errno to the correspond-
ing value:
[EBADF] The socket parameter is not a valid le descriptor.
[ECONNRESET]
One of the following conditions occurred:
The transport-provider process for this socket is no longer available.
The TCP/IP subsystem for this socket is no longer available.
The connection was forcibly closed by the peer socket.
The socket can only be closed.
[EINVAL] The value specied for the how parameter is not valid.
[ENOBUFS] There was not enough buffer space available to complete the call. A retry at a
later time may succeed.
758 Hewlett-Packard Company 527186-003