bind(2) DG/UX 4.30 bind(2)
NAME
bind - Bind a name to a socket.
SYNOPSIS
#include <sys/socket.h>
int bind (s, name, namelen)
int s;
struct sockaddr * name;
int namelen;
PARAMETERS
s Socket to bind.
name Name to bind to socket.
namelen Length of name (bytes).
DESCRIPTION
Bind requests that address <name>, be bound to socket <s>.
The rules for name binding vary between communication
domains. Consult the related documentation for a specific
domain for details about that domain.
Binding a name in the UNIX domain creates a file of type
S_IFSOCK (socket special) in the file system that the caller
must delete when it is no longer needed (using unlink). The
file created is a side-effect of the current implementation,
and may not be created in future versions of the UNIX IPC
domain.
ACCESS CONTROL
None. (See related domain specific information for
restrictions on names.)
RETURN VALUE
0 The call was successful.
-1 An error occurred. Errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EBADF <s> is not an active valid descriptor.
Licensed material--property of copyright holder(s) Page 1
bind(2) DG/UX 4.30 bind(2)
ENOTSOCK <s> is not a socket.
EADDRNOTAVAIL The address is not a valid address for the
local machine.
EADDRINUSE The address is already in use.
EINVAL The socket is already bound to an address.
EACCES The requested address is protected, and the
current user has inadequate privilege to
access it. Privilege is determined by the
euid of the process when the socket was
created.
EFAULT The <name> parameter is not in a valid part
of the user address space.
ENOBUFS No internal buffers available.
EISCONN Socket is already connected.
SEE ALSO
The related manual sections: inet(3N), inet(6F),
unix_ipc(6F), connect(2), listen(2), select(2), socket(2).
Licensed material--property of copyright holder(s) Page 2