ruby-changes:18502
From: kosaki <ko1@a...>
Date: Wed, 12 Jan 2011 23:11:18 +0900 (JST)
Subject: [ruby-changes:18502] Ruby:r30525 (trunk): * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
kosaki 2011-01-12 23:11:06 +0900 (Wed, 12 Jan 2011) New Revision: 30525 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30525 Log: * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes long type arguments. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30524) +++ ChangeLog (revision 30525) @@ -1,3 +1,8 @@ +Wed Jan 12 23:55:48 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * 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@f...> * vm_dump.c: parenthesize macro arguments. Index: io.c =================================================================== --- io.c (revision 30524) +++ io.c (revision 30525) @@ -7839,6 +7839,18 @@ # 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/