Go to the previous, next section.
int bind(int sockfd, struct sockaddr *my_addr, int
addrlen);
sockfd: [in] the socket to bind.
my_addr: [in] the address to bind the socket to.
addrlen: [in] the length of addr (in bytes).
Binds the socket sockfd to the local address my_addr. The format of the address is network dependent.
On success zero is returned. On error, -1 is returned and errno
is
set to one of the following values:
EINVAL
: the socket is already bound to an address, or
addrlen is invalid or the socket is not in the AF_UNIX
family.
EACCESS
: the address is reserved for super-user usage and
the calling task has not super-user privileges or the taks does not have
enough access rights on the path.
ENAMETOOLONG
: my_addr is too long.
EBADF
, EROFS
, EFAULT
, ENOENT
, ENOMEM
,
ENOTDIR
or ELOOP
.
Go to the previous, next section.