Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>select</b> http://www.ousob.com [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
select
======

Syntax
------

     #include <time.h>
     
     int
     select(int nfds,
            fd_set *readfds,
            fd_set *writefds,
            fd_set *exceptfds,
            struct timeval *timeout)

Description
-----------

This function waits for files to be ready for input or output, or for a
timeout.  Each fd_set represents a set of bits representing file
descriptors.  The following macros shall be used to deal with these
sets:

`FD_ZERO(p)'
     Initialize the set to all zeros.

`FD_SET(n, p)'
     Set member N in set P.

`FD_CLR(n, p)'
     Clear member N in set P.

`FD_ISSET(n, p)'
     Return the value of member N in set P.

The TIMEOUT value may be a NULL pointer (no timeout), a pointer to a
zero-value structure (poll mode), or a pointer to an interval-filled
structure (timeout).

Return Value
------------

The number of files ready.  The input sets are replaced with sets that
describe which files are ready for which operations.


Online resources provided by: http://www.ousob.com --- NG 2 HTML conversion by Dave Pearson