3 dnl Find out how to get the file descriptor associated with an open DIR*.
6 AC_DEFUN([UTILS_FUNC_DIRFD],
8 AC_REPLACE_FUNCS([dirfd])
9 AC_CHECK_DECLS([dirfd])
10 if test $ac_cv_func_dirfd = no; then
12 [how to get the file descriptor associated with an open DIR*],
24 '# systems for which the info is not available' \
28 # Skip each embedded comment.
29 case "$ac_expr" in '#'*) continue;; esac
31 DEFS="$DEFS -DDIR_TO_FD=$ac_expr"
33 [#include <sys/types.h>
36 [DIR *dir_p = opendir("."); (void) ($ac_expr);],
40 test "$dir_fd_done" = yes && break
43 ac_cv_sys_dir_to_fd=$ac_expr
46 AC_DEFINE_UNQUOTED(DIR_TO_FD,
48 [the file descriptor associated with `dir_p'])