1.1.24.7 bind

C

int bind(int fd, const struct sockaddr *addr, socklen_t len)

Description

Bind a name to a socket.

Parameters

ParametersDescription
fdSocket file descriptor.
addrPointer to socket address.
lenLength of socket address.

Returns

  • 0 - Success.

  • -1 - Error, errno set.

Remarks

errnoDescription
EFAULTSystem fault.
ENOTSOCKThe file descriptor fd does not refer to a socket.
EAFNOSUPPORTThe implementation does not support the specified address family.
ENOMEMInsufficient memory is available.
EBADMSGBad message.