www.delorie.com/djgpp/doc/libc-2.01/libc_558.html   search  
Go to the first, previous, next, last section, table of contents.


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.


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997