summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-09 03:24:42 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-09 03:24:42 +0000
commit831219203b354146565ccc421a12f7237e0e3faa (patch)
treed9d56a769bb261ca5f227e859d6e73cbb2457b95 /libc/sysdeps
parent7477fa1a17a5604040a51d980d21e27c6e281b6e (diff)
use the newer versions of functions when available (fixes sparc which doesnt provide older versions at all)
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/common/getegid.c9
-rw-r--r--libc/sysdeps/linux/common/geteuid.c12
-rw-r--r--libc/sysdeps/linux/common/getresgid.c11
-rw-r--r--libc/sysdeps/linux/common/getresuid.c7
4 files changed, 30 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c
index ff28c51b7..466d63d89 100644
--- a/libc/sysdeps/linux/common/getegid.c
+++ b/libc/sysdeps/linux/common/getegid.c
@@ -12,8 +12,13 @@
libc_hidden_proto(getegid)
-#ifdef __NR_getegid
-#define __NR___syscall_getegid __NR_getegid
+#if defined(__NR_getegid32)
+# undef __NR_getegid
+# define __NR_getegid __NR_getegid32
+_syscall0(gid_t, getegid);
+
+#elif defined(__NR_getegid)
+# define __NR___syscall_getegid __NR_getegid
static inline _syscall0(int, __syscall_getegid);
gid_t getegid(void)
{
diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c
index 819a1d65f..247f1bfda 100644
--- a/libc/sysdeps/linux/common/geteuid.c
+++ b/libc/sysdeps/linux/common/geteuid.c
@@ -12,19 +12,25 @@
libc_hidden_proto(geteuid)
-#ifdef __NR_geteuid
-#define __NR___syscall_geteuid __NR_geteuid
+#if defined(__NR_geteuid32)
+# undef __NR_geteuid
+# define __NR_geteuid __NR_geteuid32
+_syscall0(uid_t, geteuid);
+
+#elif defined(__NR_geteuid)
+# define __NR___syscall_geteuid __NR_geteuid
static inline _syscall0(int, __syscall_geteuid);
uid_t geteuid(void)
{
return (__syscall_geteuid());
}
+
#else
libc_hidden_proto(getuid)
-
uid_t geteuid(void)
{
return (getuid());
}
#endif
+
libc_hidden_def(geteuid)
diff --git a/libc/sysdeps/linux/common/getresgid.c b/libc/sysdeps/linux/common/getresgid.c
index b7f1cbc6c..158a8984f 100644
--- a/libc/sysdeps/linux/common/getresgid.c
+++ b/libc/sysdeps/linux/common/getresgid.c
@@ -10,10 +10,15 @@
#include "syscalls.h"
#include <unistd.h>
-#ifdef __NR_getresgid
+#if defined(__NR_getresgid32)
+# undef __NR_getresgid
+# define __NR_getresgid __NR_getresgid32
+_syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid)
+
+#elif defined(__NR_getresgid)
# define __NR___syscall_getresgid __NR_getresgid
-static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, egid,
- __kernel_gid_t *, rgid, __kernel_gid_t *, sgid);
+static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid,
+ __kernel_gid_t *, egid, __kernel_gid_t *, sgid);
int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid)
{
diff --git a/libc/sysdeps/linux/common/getresuid.c b/libc/sysdeps/linux/common/getresuid.c
index 37b5191c1..7f0e0f2b0 100644
--- a/libc/sysdeps/linux/common/getresuid.c
+++ b/libc/sysdeps/linux/common/getresuid.c
@@ -10,7 +10,12 @@
#include "syscalls.h"
#include <unistd.h>
-#ifdef __NR_getresuid
+#if defined(__NR_getresuid32)
+# undef __NR_getresuid
+# define __NR_getresuid __NR_getresuid32
+_syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid)
+
+#elif defined(__NR_getresuid)
# define __NR___syscall_getresuid __NR_getresuid
static inline _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid,
__kernel_uid_t *, euid, __kernel_uid_t *, suid);