int dirfd(DIR *dirp);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
This descriptor is the one used internally by the directory stream. As a result, it is useful only for functions which do not depend on or alter the file position, such as fstat(2) and fchdir(2). It will be automatically closed when closedir(3) is called.