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

This commit is contained in:
Charles Davis 2012-11-29 21:50:45 -07:00 committed by Alexandre Julliard
parent d008771bd2
commit ed5e0a6e41
4 changed files with 47 additions and 1 deletions

27
configure vendored
View File

@ -14131,6 +14131,15 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _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 fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim" "ac_cv_member_struct_stat_st_ctim" "$ac_includes_default" 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 : if test "x$ac_cv_member_struct_stat_st_ctim" = xyes; then :
@ -14140,6 +14149,15 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _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 fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default" 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 : if test "x$ac_cv_member_struct_stat_st_atim" = xyes; then :
@ -14149,6 +14167,15 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _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 fi

View File

@ -2269,7 +2269,7 @@ AC_CHECK_MEMBERS([struct option.name],,,
#endif]) #endif])
dnl Check for stat.st_blocks and ns-resolved times 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 dnl Check for sin6_scope_id
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,

View File

@ -1594,9 +1594,13 @@ static NTSTATUS set_file_times( int fd, const LARGE_INTEGER *mtime, const LARGE_
tv[1].tv_sec = st.st_mtime; tv[1].tv_sec = st.st_mtime;
#ifdef HAVE_STRUCT_STAT_ST_ATIM #ifdef HAVE_STRUCT_STAT_ST_ATIM
tv[0].tv_usec = st.st_atim.tv_nsec / 1000; 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 #endif
#ifdef HAVE_STRUCT_STAT_ST_MTIM #ifdef HAVE_STRUCT_STAT_ST_MTIM
tv[1].tv_usec = st.st_mtim.tv_nsec / 1000; 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 #endif
} }
} }
@ -1631,12 +1635,18 @@ static inline void get_file_times( const struct stat *st, LARGE_INTEGER *mtime,
RtlSecondsSince1970ToTime( st->st_atime, atime ); RtlSecondsSince1970ToTime( st->st_atime, atime );
#ifdef HAVE_STRUCT_STAT_ST_MTIM #ifdef HAVE_STRUCT_STAT_ST_MTIM
mtime->QuadPart += st->st_mtim.tv_nsec / 100; mtime->QuadPart += st->st_mtim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
mtime->QuadPart += st->st_mtimespec.tv_nsec / 100;
#endif #endif
#ifdef HAVE_STRUCT_STAT_ST_CTIM #ifdef HAVE_STRUCT_STAT_ST_CTIM
ctime->QuadPart += st->st_ctim.tv_nsec / 100; ctime->QuadPart += st->st_ctim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_CTIMESPEC)
ctime->QuadPart += st->st_ctimespec.tv_nsec / 100;
#endif #endif
#ifdef HAVE_STRUCT_STAT_ST_ATIM #ifdef HAVE_STRUCT_STAT_ST_ATIM
atime->QuadPart += st->st_atim.tv_nsec / 100; atime->QuadPart += st->st_atim.tv_nsec / 100;
#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
atime->QuadPart += st->st_atimespec.tv_nsec / 100;
#endif #endif
*creation = *mtime; *creation = *mtime;
} }

View File

@ -857,15 +857,24 @@
/* Define to 1 if `st_atim' is a member of `struct stat'. */ /* Define to 1 if `st_atim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIM #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'. */ /* Define to 1 if `st_blocks' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS #undef HAVE_STRUCT_STAT_ST_BLOCKS
/* Define to 1 if `st_ctim' is a member of `struct stat'. */ /* Define to 1 if `st_ctim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_CTIM #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'. */ /* Define to 1 if `st_mtim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM #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'. */ /* Define to 1 if `tcps_connattempt' is a member of `struct tcpstat'. */
#undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT #undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT