summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-12 14:11:06 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-12 14:11:06 +0000
commitcaab5dcee77d8278fdf578334b6d4e7f8595052e (patch)
treefa86d9e3556f17367d44c1dd6d99a1b27ae9a068 /io.c
parent38f129397bdd566a381395b3ba56062d7f762765 (diff)
* 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/trunk@30525 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 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)