[前][次][番号順一覧][スレッド一覧]

ruby-changes:54888

From: nobu <ko1@a...>
Date: Wed, 20 Feb 2019 13:02:36 +0900 (JST)
Subject: [ruby-changes:54888] nobu:r67093 (trunk): Try statx syscall

nobu	2019-02-20 13:02:30 +0900 (Wed, 20 Feb 2019)

  New Revision: 67093

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67093

  Log:
    Try statx syscall

  Modified files:
    trunk/file.c
Index: file.c
===================================================================
--- file.c	(revision 67092)
+++ file.c	(revision 67093)
@@ -1112,6 +1112,23 @@ stat_without_gvl(const char *path, struc https://github.com/ruby/ruby/blob/trunk/file.c#L1112
 						  RUBY_UBF_IO, NULL);
 }
 
+#if !defined HAVE_STATX && defined __linux__
+# ifdef HAVE_SYSCALL_H
+#   include <syscall.h>
+# elif defined HAVE_SYS_SYSCALL_H
+#   include <sys/syscall.h>
+# endif
+# if defined __NR_statx
+#   include <linux/stat.h>
+static int statx(int dirfd, const char *pathname, int flags,
+                 unsigned int mask, struct statx *statxbuf)
+{
+    return syscall(__NR_statx, dirfd, pathname, flags, mask, statxbuf);
+}
+#   define HAVE_STATX
+# endif
+#endif
+
 #ifdef HAVE_STATX
 typedef struct no_gvl_statx_data {
     struct statx *stx;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]