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

System Functions (a - d) accept(2)
NOTES
When a connection is available, a call to the select() function indicates that the le descriptor for
the original socket is ready for reading.
The accepted socket cannot itself accept more connections. The original socket remains open
and can accept more connections.
RETURN VALUES
Upon successful completion, the accept() function returns the le descriptor of the accepted
socket. If the accept() function call fails, the value -1 is returned and errno is set to indicate the
error.
ERRORS
If any of the following conditions occurs, the accept() function sets errno to the corresponding
value:
[EBADF] The socket parameter is not a valid le descriptor.
[ECONNABORTED]
The connection was aborted.
[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.
[EFAULT] A user-supplied memory buffer cannot be accessed or written.
[EINTR] The function call was interrupted by a signal that was caught before a valid con-
nection arrived.
[EINVAL] The socket is not accepting connections.
[EMFILE] No more le descriptors are available for this process.
[ENFILE] The maximum number of le descriptors for this processor are already open.
[ENOBUFS] There was not enough buffer space available to complete the call. A retry at a
later time might succeed.
[ENOMEM] Required memory resources were not available. A retry at a later time may
succeed.
[ENOTSOCK] The socket parameter does not specify a socket.
[EOPNOTSUPP]
The socket type of the specied socket does not support accepting connections.
[EWOULDBLOCK]
The sockets le descriptor is marked nonblocking (O_NONBLOCK is set) and
no connections are present to be accepted.
527186-003 Hewlett-Packard Company 13