summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
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)