#include <cafe.h> #include <cafe/network.h> int SOBind(int fd, struct sockaddr *addr, int addrlen);
|fd||Descriptor of socket to bind.|
|addr||Pointer to address structure containing address to assign the given socket.|
|addrlen||Length of address structure in bytes.|
0 upon success. Upon failure,
-1 is returned and
errno is set appropriately.
||Socket library is not initialized.|
||Insufficient memory in the stack.|
||Specified argument is invalid.|
||The argument fd does not refer to a socket.|
||The specified address is not available from the local machine.|
||The specified address is already in use.|
||Socket resource manager busy processing requests.|
||Indicates the operation was aborted. For example, this error can be returned for calls blocked on a socket after the socket is closed by another thread.|
||Internal API error, invalid error code.|
||Internal API error.|
Binds a name (address) to a socket. When a socket is created with
SOSocket it exists in a name space (address family)
but has no name assigned.
SOBind requests that the name pointed to by addr be assigned to the socket.
|Callbacks||Do not call this function from any callback function.|
|Interrupt handler||Do not call this function from any interrupt handler.|
|Exception handler||Do not call this function from any exception handler.|
2012/10/09 Updated Errors section.
2012/08/17 Cleanup pass.
2011/07/11 Added Errors section.
2011/02/21 Initial version.