GETDTABLEHI(3C)                                                GETDTABLEHI(3C)


NAME
     getdtablehi - get largest open file descriptor index

SYNOPSIS
     #include <unistd.h>

     int getdtablehi(void);

DESCRIPTION
     getdtablehi returns the index of the largest open descriptor for the
     calling process plus one.  The 'plus one' makes getdtablehi an ideal
     replacement for getdtablesize(2) when the program wishes simply to loop
     through and act on all open file descriptors, rather than up to the
     system maximum.

     If the systune(1) variable rlimit_nofile_cur_clamps_fdhi is non-zero, the
     index of the largest open descriptor less than or equal to the current
     limit for file descriptors is returned.  See setrlimit(2) for additional
     information concerning file descriptor limits.


SEE ALSO
     systune(1), close(2), getdtablesize(2), intro(2), open(2), select(2),
     setrlimit(2), dup(3C).


                                                                        Page 1