1.1.27.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.
EAFNOSUPPORTThe implementation does not support the specified address family.
ENOMEMInsufficient memory is available.
EBADMSGBad message.
EAGAINThe socket is nonblocking, and the binding cannot be completed immediately.