summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ecd75c4d5b..581803ad32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 12 23:55:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
+ long type arguments.
+
Wed Jan 12 19:37:10 2011 Tanaka Akira <akr@fsij.org>
* vm_dump.c: parenthesize macro arguments.
diff --git a/io.c b/io.c
index 6e8fa0b2f1..f8aa6dd3f7 100644
--- a/io.c
+++ b/io.c
@@ -7839,6 +7839,18 @@ rb_f_syscall(int argc, VALUE *argv)
# else
# error ---->> it is asserted that __syscall takes the first argument and returns retval in 64bit signed integer. <<----
# endif
+#elif defined linux
+# define SYSCALL syscall
+# define NUM2SYSCALLID(x) NUM2LONG(x)
+# define RETVAL2NUM(x) LONG2NUM(x)
+ /*
+ * Linux man page says, syscall(2) function prototype is below.
+ *
+ * int syscall(int number, ...);
+ *
+ * But, it's incorrect. Actual one takes and returned long. (see unistd.h)
+ */
+ long num, retval = -1;
#else
# define SYSCALL syscall
# define NUM2SYSCALLID(x) NUM2INT(x)