ntdll: Add sub-second resolution to NtQueryInformationFile.

This commit is contained in:
Michael Karcher 2008-08-17 19:03:44 +02:00 committed by Alexandre Julliard
parent f2b0e3168a
commit af2d274f0e
4 changed files with 334 additions and 2 deletions

303
configure vendored
View File

@ -21235,6 +21235,309 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for struct stat.st_mtim" >&5
echo $ECHO_N "checking for struct stat.st_mtim... $ECHO_C" >&6; }
if test "${ac_cv_member_struct_stat_st_mtim+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_mtim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_mtim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_mtim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_mtim=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_mtim" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_mtim" >&6; }
if test $ac_cv_member_struct_stat_st_mtim = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_MTIM 1
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for struct stat.st_ctim" >&5
echo $ECHO_N "checking for struct stat.st_ctim... $ECHO_C" >&6; }
if test "${ac_cv_member_struct_stat_st_ctim+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_ctim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_ctim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_ctim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_ctim=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_ctim" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_ctim" >&6; }
if test $ac_cv_member_struct_stat_st_ctim = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_CTIM 1
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for struct stat.st_atim" >&5
echo $ECHO_N "checking for struct stat.st_atim... $ECHO_C" >&6; }
if test "${ac_cv_member_struct_stat_st_atim+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_atim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_atim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_atim)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_member_struct_stat_st_atim=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_stat_st_atim=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_atim" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_atim" >&6; }
if test $ac_cv_member_struct_stat_st_atim = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIM 1
_ACEOF
fi

View File

@ -1595,8 +1595,8 @@ AC_CHECK_MEMBERS([struct option.name],,,
#include <getopt.h>
#endif])
dnl Check for stat.st_blocks
AC_CHECK_MEMBERS([struct stat.st_blocks])
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])
dnl Check for sin6_scope_id
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,

View File

@ -1565,6 +1565,16 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
RtlSecondsSince1970ToTime( st.st_mtime, &info->LastWriteTime);
RtlSecondsSince1970ToTime( st.st_ctime, &info->ChangeTime);
RtlSecondsSince1970ToTime( st.st_atime, &info->LastAccessTime);
#ifdef HAVE_STRUCT_STAT_ST_MTIM
info->CreationTime.QuadPart += st.st_mtim.tv_nsec / 100;
info->LastWriteTime.QuadPart += st.st_mtim.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_CTIM
info->ChangeTime.QuadPart += st.st_ctim.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_ATIM
info->LastAccessTime.QuadPart += st.st_atim.tv_nsec / 100;
#endif
}
}
break;
@ -1653,6 +1663,16 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
RtlSecondsSince1970ToTime( st.st_mtime, &info->BasicInformation.LastWriteTime);
RtlSecondsSince1970ToTime( st.st_ctime, &info->BasicInformation.ChangeTime);
RtlSecondsSince1970ToTime( st.st_atime, &info->BasicInformation.LastAccessTime);
#ifdef HAVE_STRUCT_STAT_ST_MTIM
info->BasicInformation.CreationTime.QuadPart += st.st_mtim.tv_nsec / 100;
info->BasicInformation.LastWriteTime.QuadPart += st.st_mtim.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_CTIM
info->BasicInformation.ChangeTime.QuadPart += st.st_ctim.tv_nsec / 100;
#endif
#ifdef HAVE_STRUCT_STAT_ST_ATIM
info->BasicInformation.LastAccessTime.QuadPart += st.st_atim.tv_nsec / 100;
#endif
info->InternalInformation.IndexNumber.QuadPart = st.st_ino;
info->EaInformation.EaSize = 0;
info->AccessInformation.AccessFlags = 0; /* FIXME */

View File

@ -741,9 +741,18 @@
/* Define to 1 if `f_blocks' is member of `struct statvfs'. */
#undef HAVE_STRUCT_STATVFS_F_BLOCKS
/* Define to 1 if `st_atim' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIM
/* Define to 1 if `st_blocks' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS
/* Define to 1 if `st_ctim' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_CTIM
/* Define to 1 if `st_mtim' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM
/* Define to 1 if you have the <syscall.h> header file. */
#undef HAVE_SYSCALL_H