[uClibc] sparc32 linux syscall fixes

Stefan Holst mail at s-holst.de
Mon Mar 15 01:04:32 UTC 2004


hi!

the attached patch fixes compilation for linux-sparc.
__NR_(s|g)etres(u|g)id syscall numbers are not defined
for sparc32, but __NR_(s|g)etres(u|g)id32 are.
i didn't check deeply whether the *32 versions differ
from the other ones but at least it compiles better.

socket syscall isn't implemented in linux but
__NR_socket is defined. the patch undefs __NR_socket for
linux so that socketcall syscall is used. this has
been tested and works much better.

-- 
RY  Stefan
+-----------------+----------------+
| mail at s-holst.de | www.s-holst.de |
+-----------------+----------------+
-------------- next part --------------
diff -ur uClibc-orig/libc/inet/socketcalls.c uClibc/libc/inet/socketcalls.c
--- uClibc-orig/libc/inet/socketcalls.c	2002-07-07 09:27:42.000000000 +0200
+++ uClibc/libc/inet/socketcalls.c	2004-03-15 01:19:12.999063296 +0100
@@ -307,6 +307,10 @@
 #endif
 
 #ifdef L_socket
+/* for linux: __NR_socket defined, but socket syscall not implemented */
+#ifdef __linux__
+#undef __NR_socket
+#endif
 #ifdef __NR_socket
 _syscall3(int, socket, int, family, int, type, int, protocol);
 #else
diff -ur uClibc-orig/libc/sysdeps/linux/common/getresgid.c uClibc/libc/sysdeps/linux/common/getresgid.c
--- uClibc-orig/libc/sysdeps/linux/common/getresgid.c	2004-01-22 00:27:40.000000000 +0100
+++ uClibc/libc/sysdeps/linux/common/getresgid.c	2004-03-15 00:57:16.193248208 +0100
@@ -9,7 +9,11 @@
 
 #include "syscalls.h"
 
+#ifdef __NR_getresgid
 #define __NR___syscall_getresgid __NR_getresgid
+#else
+#define __NR___syscall_getresgid __NR_getresgid32
+#endif
 static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, egid,
 		  __kernel_gid_t *, rgid, __kernel_gid_t *, sgid);
 
diff -ur uClibc-orig/libc/sysdeps/linux/common/getresuid.c uClibc/libc/sysdeps/linux/common/getresuid.c
--- uClibc-orig/libc/sysdeps/linux/common/getresuid.c	2004-01-22 00:27:40.000000000 +0100
+++ uClibc/libc/sysdeps/linux/common/getresuid.c	2004-03-15 00:56:39.712794080 +0100
@@ -9,7 +9,11 @@
 
 #include "syscalls.h"
 
+#ifdef __NR_getresuid
 #define __NR___syscall_getresuid __NR_getresuid
+#else
+#define __NR___syscall_getresuid __NR_getresuid32
+#endif
 static inline _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid,
 		  __kernel_uid_t *, euid, __kernel_uid_t *, suid);
 
diff -ur uClibc-orig/libc/sysdeps/linux/common/setresgid.c uClibc/libc/sysdeps/linux/common/setresgid.c
--- uClibc-orig/libc/sysdeps/linux/common/setresgid.c	2004-01-22 00:27:40.000000000 +0100
+++ uClibc/libc/sysdeps/linux/common/setresgid.c	2004-03-15 00:58:13.263572200 +0100
@@ -9,7 +9,11 @@
 
 #include "syscalls.h"
 
+#ifdef __NR_setresgid
 #define __NR___syscall_setresgid __NR_setresgid
+#else
+#define __NR___syscall_setresgid __NR_setresgid32
+#endif
 static inline _syscall3(int, __syscall_setresgid,
 		__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid);
 
diff -ur uClibc-orig/libc/sysdeps/linux/common/setresuid.c uClibc/libc/sysdeps/linux/common/setresuid.c
--- uClibc-orig/libc/sysdeps/linux/common/setresuid.c	2004-01-22 00:27:40.000000000 +0100
+++ uClibc/libc/sysdeps/linux/common/setresuid.c	2004-03-15 00:57:46.341664952 +0100
@@ -9,7 +9,11 @@
 
 #include "syscalls.h"
 
+#ifdef __NR_setresuid
 #define __NR___syscall_setresuid __NR_setresuid
+#else
+#define __NR___syscall_setresuid __NR_setresuid32
+#endif
 static inline _syscall3(int, __syscall_setresuid,
 		__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid);
 


More information about the uClibc mailing list