06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pNA+ <strong>System</strong> <strong>Calls</strong> accept<br />

Return Value<br />

Error Codes<br />

See Also<br />

addr Points to a structure of type sockaddr_in where accept()<br />

stores the address of the connected socket. The structure<br />

sockaddr_in is defined in the file and has the following<br />

format:<br />

struct sockaddr_in {<br />

short sin_family; /* must be AF_INET */<br />

unsigned short sin_port; /* 16-bit port number */<br />

struct in_addr sin_addr; /* 32-bit IP address */<br />

char sin_zero[8]; /* must be 0 */<br />

};<br />

This structure cannot be packed.<br />

addrlen Points to an integer equal to 16, which is the size in bytes of<br />

the sockaddr_in structure.<br />

If this call succeeds, it returns a non-negative integer that is a descriptor for the<br />

accepted socket. It returns -1 on error.<br />

Hex Mnemonic Description<br />

0x5009 EBADS The socket descriptor is invalid.<br />

0x5017 ENFILE An internal table has run out of<br />

space.<br />

0x5016 EINVALID An argument is invalid.<br />

0x5023 EWOULDBLOCK This operation would block and the<br />

socket is marked non-blocking.<br />

0x5034 ECONNABORTED The connection has been aborted by<br />

the peer.<br />

0x5037 ENOBUFS An internal buffer is required but cannot<br />

be allocated.<br />

0x502D EOPNOTSUPP The requested operation is not valid<br />

for this type of socket.<br />

bind, connect, listen, select, socket<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 4-3<br />

4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!