bind - bind a name to a socket
#include <sys/socket.h>
bind() assigns a name to an unnamed socket. When a socket is created with socket(), it exists in a name space (address family) but has no name assigned. bind() requests that the name pointed to by name be assigned to the socket.
If the bind is successful, a 0 value is returned. A return value of -1 indicates an error, which is further specified in the global errno.
This function is a member of Unison's IOLIB family of functions. IOLIB is implemented as a message passing and generalized interface layer. Each Unison I/O server is responsible for its own error reporting.
For an exact list of error codes returned by a particular server, refer to that server's documentation in the Unison Programmer's Guide for each specific platform.
Servers may implement these errors codes in response to this function.
The bind() call will fail if: