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 if test $ac_cv_func_dirfd = no; then
11 [how to get the file descriptor associated with an open DIR*],
23 '# systems for which the info is not available' \
27 # Skip each embedded comment.
28 case "$ac_expr" in '#'*) continue;; esac
30 DEFS="$DEFS -DDIR_TO_FD=$ac_expr"
32 [#include <sys/types.h>
35 [DIR *dir_p = opendir("."); (void) ($ac_expr);],
39 test "$dir_fd_done" = yes && break
42 ac_cv_sys_dir_to_fd=$ac_expr
45 AC_DEFINE_UNQUOTED(DIR_TO_FD,
47 [the file descriptor associated with `dir_p'])