Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (a - d) bind(2)
NOTES
This function requires that the feature-test macro _XOPEN_SOURCE_EXTENDED be specified
when you compile the module.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
RETURN VALUES
Upon successful completion, the bind( ) function returns the value 0 (zero). Otherwise, the
bind( ) function returns -1 and sets errno to indicate the error.
ERRORS
If any of the following conditions occurs, the bind() function sets errno to the corresponding
value:
[EACCES] One of the following conditions occurred:
• The specified address is protected and the current user does not have
permission to bind to it.
• The socket is an AF_UNIX socket and either a component of the path
prefix denies search permission, or the requested name requires writing
in a directory with a mode that denies write permission.
[EADDRINUSE]
The specified address is already in use.
[EADDRNOTAVAIL]
The specified address is not available on this HP NonStop node.
[EAFNOSUPPORT]
The specified address is not a valid address for the address family of the
specified socket.
[EBADF] The socket parameter is not a valid file 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.
[EDESTADDRREQ]
The address parameter for an AF_UNIX socket is a null pointer.
[EFAULT] A user-supplied memory buffer cannot be accessed.
[EINVAL] One of the following conditions exists:
• The socket is already bound to an address.
• The socket has been shut down.
• The size specified for the address_len parameter is not valid for an
address in the address family that is used by this connection.
527186-023 Hewlett-Packard Company 1−15