SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
int bind(int s, const struct sockaddr *name, socklen_t namelen);
DESCRIPTION
The
PARAMETERS
- s
-
Specifies the integer descriptor of the unbounded socket.
- name
-
Points to a sockaddr structure containing the address to be bound to the socket. The length and format of the address depend on the address family of the socket.
- namelen
-
Specifies the length of name in bytes.
RETURN VALUES
If successful,
- EACCES
-
For sockets in the AF_UNIX address family, the specified address does not specify a disk file local to the machine.
-
For sockets in the AF_UNIX address family, a component of the path prefix denies search permission, or the requested name requires writing in a directory with a mode that denies write permission.
- EADDRINUSE
-
The specified address is already in use. [See the SO_REUSEADDR socket option under
setsockopt() .] - EAFNOSUPPORT
-
The protocol used in the creation of specified socket does not support the specified address family.
- EBADF
-
s is not a valid descriptor.
- EFAULT
-
name is an invalid pointer or the namelen parameter is too small (less than the size of a struct sockaddr).
- EINVAL
-
The socket is already bound to an address.
- ENETDOWN
-
The Windows sockets implementation has detected that the network subsystem has failed.
- ENOBUFS
-
Not enough buffers are available; there are too many connections.
- ENOTSOCK
-
The descriptor is not a socket.
CONFORMANCE
UNIX98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
The NuTCRACKER Platform supports all
the address families that WinSock 2.0 supports.
Sockets from the AF_UNIX address family are bound to file system
objects. The NuTCRACKER Platform requires that the paths be local to
the system on which
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
connect() ,getsockname() ,listen() ,socket()
PTC MKS Toolkit 10.4 Documentation Build 39.