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.

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

Return Value<br />

Error Codes<br />

See Also<br />

}<br />

}<br />

if (FD_ISSET(s1, &read_mask))<br />

{<br />

/* socket 1 has data available */<br />

}<br />

if (FD_ISSET(s2, &read_mask))<br />

{<br />

/* socket 2 has data available */<br />

}<br />

If two tasks attempt to use select() on the same socket for the same conditions,<br />

an error occurs.<br />

A -1 is returned if an error occurs and the socket descriptor masks remain<br />

unchanged; a 0 is returned if a timeout occurs. On success a nonzero value is<br />

returned that indicates the number of descriptors on which events have occurred.<br />

Hex Mnemonic Description<br />

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

0x504A ECOLL Collision in select(); these conditions<br />

have already been selected by<br />

another task.<br />

accept, connect, recv, send<br />

4-56 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

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

Saved successfully!

Ooh no, something went wrong!