INtime SDK Help
bind
INtime Help

Assign a local protocol address to a socket.

#include <sys/types.h>
#include <sys/socket.h>
int
bind(int s, const struct sockaddr *addr, socklen_t addrlen);

Description

The bind() system call assigns the local protocol address to a socket. When a socket is created with socket it exists in an address family space but has no protocol address assigned. The bind() system call requests that addr be assigned to the socket.

Remarks

For maximum portability, you should always zero the socket address structure before populating it and passing it to bind().

Return Values

0 (zero)
Success
-1
Failure. The global variable errno is set to indicate the error:
EAGAIN Kernel resources to complete the request are temporarily unavailable.
EBADF The s argument is not a valid descriptor.
ENOTSOCK The s argument is not a socket.
EADDRNOTAVAIL The specified address is not available from the local machine.
EADDRINUSE The specified address is already in use.
EACCES The requested address is protected, and the current user has inadequate permission to access it.
EFAULT The addr argument is not in a valid part of the user address space.

Requirements

Versions Link to
INtime 4.0 netlib.lib
See Also