[git commit master] MIPS: restore INLINE_SYSCALL macro

Austin Foxley austinf at cetoncorp.com
Tue Apr 27 15:59:54 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=23df492e35cf3206b89c699229b35b9cb17791ee
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

The MIPS specific INLINE_SYSCALL macro has been renamed to
INLINE_SYSCALL_NCS with:

  763bbf9e9a27426c9be8322dca5ddf2cb4dbc464

  syscall: unify part 2: NCS variety

  Declare common NCS (non-constant syscall) variants and convert the
  existing ports over to this.

This change breaks system calls. The code generated with using of the
new macro does not obey the restartable syscall convention used by the
linux kernel. When it tries to restart the syscall the errno value is
not being replaced by the syscall number.

This causes weird behaviour of the 'ping' command in busybox for
example:

root at OpenWrt:/# ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254): 56 data bytes
64 bytes from 192.168.1.254: seq=0 ttl=128 time=6.292 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=1 ttl=128 time=0.719 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=2 ttl=128 time=0.489 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=3 ttl=128 time=0.486 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=4 ttl=128 time=0.487 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=5 ttl=128 time=0.939 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=6 ttl=128 time=0.971 ms
ping: recvfrom: Function not implemented
64 bytes from 192.168.1.254: seq=7 ttl=128 time=0.488 ms
ping: recvfrom: Funct^C

Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 libc/sysdeps/linux/mips/bits/syscalls.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h
index 28b0f91..944d038 100644
--- a/libc/sysdeps/linux/mips/bits/syscalls.h
+++ b/libc/sysdeps/linux/mips/bits/syscalls.h
@@ -19,9 +19,9 @@
 
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */
-#define INLINE_SYSCALL_NCS(name, nr, args...)                               \
+#define INLINE_SYSCALL(name, nr, args...)                               \
   ({ INTERNAL_SYSCALL_DECL(err);					\
-     long result_var = INTERNAL_SYSCALL_NCS (name, err, nr, args);		\
+     long result_var = INTERNAL_SYSCALL(name, err, nr, args);		\
      if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) )			\
        {								\
 	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));	\
-- 
1.6.3.3



More information about the uClibc-cvs mailing list