NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO
#include <sys/types.h> #include <sys/socket.h>int bind(int s, const struct sockaddr *name, int namelen);
POSIX_SOCKETS
The bind system call assigns a name to an unnamed socket. When a socket is created using socket(2POSIX) it exists in a name space (address family) but has no name assigned to it. The bind system call requests that name be assigned to the socket.
Upon successful completion, bind returns 0; otherwise it returns -1 and sets errno to indicate one of the following error conditions:
The s argument is not a valid descriptor.
The s argument is not a socket.
The specified address is not available from the local machine.
The specified address is already in use.
The socket is already bound to an address.
The requested address is protected, and the current user has inadequate permission to access it.
The name parameter is not in a valid part of the c_actor's address space.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO