3 bind \- binds an address to a socket
6 #include <sys/socket.h>
10 int bind(int \fIsd\fP, const struct sockaddr * \fIaddr\fP, socklen_t \fIaddr_len\fP);
14 bind() specifies the \fIaddr\fP (IP address and port for PF_INET or path for PF_UNIX)
15 to assign to socket \fIsd\fP.
17 On success, this function returns 0. On error, -1 is returned and
22 The socket type is not supported by bind().
25 The address family is not supported by bind().
28 The address is not available.
31 The sun_path in struct sockaddr_un is too long.
34 The address is already bound to the socket.
37 The argument \fIsd\fP is not a descriptor.
40 The argument \fIsd\fP is a descriptor, but not a socket descriptor.
43 The address pointed to by \fIaddr\fP is not in a
44 valid part of the process address space.