Commit ed5e0a6e authored by Charles Davis's avatar Charles Davis Committed by Alexandre Julliard

ntdll: Add support for nanosecond precision file times on *BSD.

parent d008771b
......@@ -14132,6 +14132,15 @@ _ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
_ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim" "ac_cv_member_struct_stat_st_ctim" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_ctim" = xyes; then :
......@@ -14141,6 +14150,15 @@ _ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimespec" "ac_cv_member_struct_stat_st_ctimespec" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_ctimespec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1
_ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_atim" = xyes; then :
......@@ -14150,6 +14168,15 @@ _ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec" "ac_cv_member_struct_stat_st_atimespec" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_atimespec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1
_ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "#ifdef HAVE_SYS_TYPES_H
......
......@@ -2269,7 +2269,7 @@ AC_CHECK_MEMBERS([struct option.name],,,
#endif])
dnl Check for stat.st_blocks and ns-resolved times
AC_CHECK_MEMBERS([struct stat.st_blocks,struct stat.st_mtim,struct stat.st_ctim,struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_blocks,struct stat.st_mtim,struct stat.st_mtimespec,struct stat.st_ctim,struct stat.st_ctimespec,struct stat.st_atim,struct stat.st_atimespec])
dnl Check for sin6_scope_id
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
......
......@@ -1594,9 +1594,13 @@ static NTSTATUS set_file_times( int fd, const LARGE_INTEGER *mtime, const LARGE_
tv[1].tv_sec = st.st_mtime;
#ifdef HAVE_STRUCT_STAT_ST_ATIM
tv[0].tv_usec = st.st_atim.tv_nsec / 1000;
#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
tv[0].tv_usec = st.st_atimespec.tv_nsec / 1000;
#endif
#ifdef HAVE_STRUCT_STAT_ST_MTIM
tv[1].tv_usec = st.st_mtim.tv_nsec / 1000;
#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
tv[1].tv_usec = st.st_mtimespec.tv_nsec / 1000;
#endif
}
}
......@@ -1631,12 +1635,18 @@ static inline void get_file_times( const struct stat *st, LARGE_INTEGER *mtime,
RtlSecondsSince1970ToTime( st->st_atime, atime );
#ifdef HAVE_STRUCT_STAT_ST_MTIM
mtime->QuadPart += st->st_mtim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
mtime->QuadPart += st->st_mtimespec.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_CTIM
ctime->QuadPart += st->st_ctim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_CTIMESPEC)
ctime->QuadPart += st->st_ctimespec.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_ATIM
atime->QuadPart += st->st_atim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
atime->QuadPart += st->st_atimespec.tv_nsec / 100;
#endif
*creation = *mtime;
}
......
......@@ -857,15 +857,24 @@
/* Define to 1 if `st_atim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIM
/* Define to 1 if `st_atimespec' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC
/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS
/* Define to 1 if `st_ctim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_CTIM
/* Define to 1 if `st_ctimespec' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_CTIMESPEC
/* Define to 1 if `st_mtim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM
/* Define to 1 if `st_mtimespec' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIMESPEC
/* Define to 1 if `tcps_connattempt' is a member of `struct tcpstat'. */
#undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT
......
Markdown is supported
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