diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-24 11:57:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-24 11:57:18 +0000 |
commit | 23a8183bea8dda2d7528b57f2e0c8bc31162db3e (patch) | |
tree | 8e64e549c56714f87ef0a65f4f80628ca7d4bf03 | |
parent | a582007e3611e1d6e1d57b697391be74dc03c2ac (diff) | |
download | ruby-23a8183bea8dda2d7528b57f2e0c8bc31162db3e.tar.gz |
Check stx_btime in struct statx
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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) { |