Commit c177c33c authored by Mark Andrews's avatar Mark Andrews
Browse files

Use '#include <sys/stat.h>' for the stat structure definition

POSIX.1-2008 changed the st_atim, st_mtim, and st_ctime members of the
struct stat from time_t to struct timespec and because not all operating
systems already implemented this version of the standard or historically
deviated to include own nanosecond precision in the structure.

The autoconf script used to include <sys/fcntl.h> which contradicts
POSIX.1 as it mandates <sys/stat.h> inclusion.  Change the autoconf
check to include <sys/stat.h>.

Also fix the missing AC_MSG_RESULT([yes/no]) in the check.
parent 33035de1
Pipeline #84785 failed with stages
in 23 minutes and 59 seconds
......@@ -1058,11 +1058,13 @@ AC_COMPILE_IFELSE(
AC_MSG_CHECKING([for st_mtim.tv_nsec])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/fcntl.h>]],
[[#include <sys/stat.h>]],
[[struct stat s;
return(s.st_mtim.tv_nsec);
]])],
[AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])])
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])],
[AC_MSG_RESULT([no])])
#
# Check for if_nametoindex() for IPv6 scoped addresses support
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment