diff options
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | file.c | 7 |
2 files changed, 8 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index cf3d06884e..d251da9915 100644 --- a/configure.ac +++ b/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)]) @@ -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) { |