home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / time / select.txh < prev    next >
Encoding:
Text File  |  1995-07-23  |  1.0 KB  |  50 lines

  1. @node select, unix
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <time.h>
  6.  
  7. int
  8. select(int nfds,
  9.     fd_set *readfds,
  10.     fd_set *writefds,
  11.     fd_set *exceptfds,
  12.     struct timeval *timeout)
  13. @end example
  14.  
  15. @subheading Description
  16.  
  17. This function waits for files to be ready for input or output, or for
  18. a timeout.  Each fd_set represents a set of bits representing file
  19. descriptors.  The following macros shall be used to deal with these
  20. sets:
  21.  
  22. @table @code
  23.  
  24. @item FD_ZERO(p)
  25.  
  26. Initialize the set to all zeros.
  27.  
  28. @item FD_SET(n, p)
  29.  
  30. Set member @var{n} in set @var{p}.
  31.  
  32. @item FD_CLR(n, p)
  33.  
  34. Clear member @var{n} in set @var{p}.
  35.  
  36. @item FD_ISSET(n, p)
  37.  
  38. Return the value of member @var{n} in set @var{p}.
  39.  
  40. @end table
  41.  
  42. The @var{timeout} value may be a NULL pointer (no timeout), a pointer
  43. to a zero-value structure (poll mode), or a pointer to an
  44. interval-filled structure (timeout).
  45.  
  46. @subheading Return Value
  47.  
  48. The number of files ready.  The input sets are replaced with sets that
  49. describe which files are ready for which operations.
  50.