NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
#include <sys/types.h> #include <sys/socket.h>int bind(int s, const struct sockaddr *name, int namelen);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
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 namelen argument is invalid.
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 process's address space.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
MT-level |
Mt-safe |
NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO