1.1.24.6 accept

C

int accept(int fd, struct sockaddr *addr, socklen_t *len)

Description

Accept a connection on a socket.

Parameters

ParametersDescription
fdSocket file descriptor.
addrPointer to a structure to filled in with the address of the peer socket.
lenLength of address structure.

Returns

  • 0 - Success.

  • -1 - Error, errno set.

Remarks

errnoDescription
EBADFThe argument fd is not a valid file descriptor.
ENOMEMInsufficient memory is available.
EWOULDBLOCKThe socket is marked nonblocking and no connections are present to be accepted.