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. A name must be bound to the socket before the socket can be used.
int bind( int s, struct sockaddr* name, int namelen );
s
name
namelen
0
(zero)
-1
and the function sets errno to one of these values:
EBADF |
Invalid file descriptor or file not opened for writing. |
ENOSPC |
No space left on device. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/sys/socket.h | sys/types.h sys/socket.h |
netiff3m.lib |