Check stx_btime in struct statx
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a582007e36
commit
23a8183bea
17
configure.ac
17
configure.ac
@ -1563,6 +1563,8 @@ AC_CHECK_MEMBERS([struct stat.st_ctim])
|
||||
AC_CHECK_MEMBERS([struct stat.st_ctimespec])
|
||||
AC_CHECK_MEMBERS([struct stat.st_ctimensec])
|
||||
AC_CHECK_MEMBERS([struct stat.st_birthtimespec])
|
||||
AS_IF([test "x$ac_cv_member_struct_stat_st_birthtimespec" != xyes],
|
||||
[AC_CHECK_MEMBERS([struct statx.stx_btime])])
|
||||
|
||||
AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H
|
||||
@%:@include <time.h>
|
||||
@ -1885,19 +1887,8 @@ AC_CHECK_FUNCS(utimes)
|
||||
AC_CHECK_FUNCS(wait4)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
|
||||
AS_CASE(["$target_os"],[aix*],[ac_cv_func_statx=no],[AC_CHECK_FUNCS(statx)])
|
||||
AS_IF([test "$ac_cv_func_statx" = no], [AS_CASE(["$target_os"], [linux*],
|
||||
[AC_CHECK_DECLS([__NR_statx], [ac_cv_func_statx=syscall], [],
|
||||
[
|
||||
@%:@ ifdef HAVE_SYSCALL_H
|
||||
@%:@ include <syscall.h>
|
||||
@%:@ elif defined HAVE_SYS_SYSCALL_H
|
||||
@%:@ include <sys/syscall.h>
|
||||
@%:@ endif
|
||||
])
|
||||
])
|
||||
])
|
||||
AS_IF([test "$ac_cv_func_statx" = syscall], [AC_DEFINE(HAVE_STATX, 0)])
|
||||
AS_IF([test "x$ac_cv_member_struct_statx_stx_btime" = xyes],
|
||||
[AC_CHECK_FUNCS(statx)])
|
||||
|
||||
AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*],
|
||||
[RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
|
||||
|
7
file.c
7
file.c
@ -1114,9 +1114,10 @@ stat_without_gvl(const char *path, struct stat *st)
|
||||
RUBY_UBF_IO, NULL);
|
||||
}
|
||||
|
||||
#if !defined(HAVE_STAT_BIRTHTIME) && defined(HAVE_STATX)
|
||||
#if !defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) && \
|
||||
defined(HAVE_STRUCT_STATX_STX_BTIME)
|
||||
|
||||
# if HAVE_STATX == 0
|
||||
# ifndef HAVE_STATX
|
||||
# ifdef HAVE_SYSCALL_H
|
||||
# include <syscall.h>
|
||||
# elif defined HAVE_SYS_SYSCALL_H
|
||||
@ -2402,7 +2403,7 @@ rb_file_ctime(VALUE obj)
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(HAVE_STAT_BIRTHTIME) || defined(HAVE_STATX)
|
||||
#if defined(HAVE_STAT_BIRTHTIME)
|
||||
RUBY_FUNC_EXPORTED VALUE
|
||||
rb_file_s_birthtime(VALUE klass, VALUE fname)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user