HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

b
bind(2) bind(2)
[EAFNOSUPPORT] The specified address is not a valid address for the address family of this socket.
[EBADF] s is not a valid file descriptor.
[EDESTADDRREQ] No addr parameter was specified.
[EFAULT] addr is not a valid pointer.
[EINVAL] The socket is already bound to an address, the socket has been shut down, addrlen is
a bad value, or an attempt was made to
bind() an AF_UNIX socket to an NFS-
mounted (remote) name.
AF_CCITT: The protocol-ID length is negative or greater than 8, the X.121 address
string contains an illegal character, or the X.121 address string is greater than 15
digits long.
AF_VME_LINK: An explicit bind can be made only to a well-known port.
[ENETDOWN] The x25ifname field name specifies an interface that was shut down, or never initial-
ized, or whose Level 2 protocol indicates that the link is not working: Wires might be
broken, the interface hoods on the modem are broken, the modem failed, the phone
connection failed (this error can be returned by AF_CCITT only), noise interfered with
the line for a long period of time.
[ENETUNREACH] The X.25 Level 2 protocol is down. The X.25 link is not working: Wires might be bro-
ken, or connections are loose on the interface hoods at the modem, the modem failed,
or noise interfered with the line for an extremely long period of time.
[ENOBUFS] No buffer space is available. The
bind() cannot complete.
[ENOMEM] No memory is available. The bind() cannot complete.
[ENODEV] The x25ifname field name specifies a nonexistent interface. (This error can be
returned by AF_CCITT only.)
[ENOTSOCK] s is a valid file descriptor, but it is not a socket.
[EOPNOTSUPP] The socket referenced by s does not support address binding.
[EISCONN] The connection is already bound. (AF_VME_LINK.)
OBSOLESCENCE
Currently, the
socklen_t and size_t types are the same size. This is compatible with the UNIX 95
and UNIX 03 profiles. However, in a future release, socklen_t might be a different size, but that should
not adversely affect application behavior in this case. Applications may use socklen_t now. But appli-
cations that need to be portable to the UNIX 95 profile should follow the X/Open specification (see
xopen_networking(7)).
WARNINGS
Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX
BSD Sockets specification to the same executable may result in unexpected behavior, including application
abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy.
FUTURE DIRECTION
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open
Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with
X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will avoid
migration problems (see xopen_networking(7)).
AUTHOR
bind() was developed by HP and the University of California, Berkeley.
SEE ALSO
connect(2), getsockname(2), listen(2), socket(2), privileges(5), thread_safety(5), inet(7F), IPv6(7P), TCP(7P),
UDP(7P), UNIX(7P), xopen_networking(7).
STANDARDS CONFORMANCE
bind(): XPG4, UNIX 95, UNIX 03
60 Hewlett-Packard Company 2 HP-UX 11i Version 3: February 2007