5 dnl Check whether struct dirent has a member named d_ino.
8 # Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2018 Free Software
11 # This file is free software; the Free Software Foundation
12 # gives unlimited permission to copy and/or distribute it,
13 # with or without modifications, as long as this notice is preserved.
15 AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
16 [AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
17 AC_CACHE_CHECK([for d_ino member in directory struct],
18 [gl_cv_struct_dirent_d_ino],
21 [[#include <sys/types.h>
25 [[DIR *dp = opendir (".");
32 { closedir (dp); return 2; }
33 if (lstat (e->d_name, &st) != 0)
34 { closedir (dp); return 3; }
35 if (e->d_ino != st.st_ino)
36 { closedir (dp); return 4; }
40 [gl_cv_struct_dirent_d_ino=yes],
41 [gl_cv_struct_dirent_d_ino=no],
43 # Guess yes on glibc systems with Linux kernel.
44 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
45 # Guess no on native Windows.
46 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
47 # If we don't know, assume the worst.
48 *) gl_cv_struct_dirent_d_ino="guessing no" ;;
51 case "$gl_cv_struct_dirent_d_ino" in
53 AC_DEFINE([D_INO_IN_DIRENT], [1],
54 [Define if struct dirent has a member d_ino that actually works.])