HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

s
select(2) select(2)
/*
* Set num_of_fds to the required value.
* User can set it to the maximum possible value the kernel is
* configured for, by using sysconf(_SC_OPEN_MAX).
* Note that, if you are not using these many files, you are
* wasting too much space.
*/
num_of_fds = sysconf(_SC_OPEN_MAX);
s = sizeof(long);
/*
* howmany is a macro defined in sys/types.h
*/
f = (struct fd_set *)malloc(s*howmany(num_of_fds, s*8);
/*
* Use f wherever struct fd_set * is used.
* It can be used to test num_of_fds file descriptors.
*/
SEE ALSO
fcntl(2), poll(2), read(2), write(2), <sys/time.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
Section 2296 Hewlett-Packard Company 3 HP-UX 11i Version 1: September 2005