summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:35:22 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:35:22 +0000
commit161fde4a43ba6f06abec13b28c82336f467eb6cf (patch)
tree474cd413611044b7d3cc80845f270db6d2c87b7b /io.c
parent54d8811ce66c27cd5af6341f58e482f0c4d8d79f (diff)
merges r30525 from trunk into ruby_1_9_2.
-- * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes long type arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/io.c b/io.c
index 0a110f9ea2..099ad2c756 100644
--- a/io.c
+++ b/io.c
@@ -7555,6 +7555,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)