From 41070dd15f2c5916dfc96da4c256dd04d7f9c837 Mon Sep 17 00:00:00 2001 From: Jack Ren Date: Tue, 17 Apr 2012 11:16:18 +0800 Subject: [PATCH] bionic: Fix wrong prototype of system call getresuid/getresgid In bionic/libc/SYSCALLS.TXT, the prototypes of system call getresuid/getresgid are incorrect. According to man page, they should be: int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad Signed-off-by: Jin Wei Signed-off-by: Jack Ren Signed-off-by: Bruce Beare --- libc/SYSCALLS.TXT | 4 ++-- libc/arch-x86/syscalls/getresgid.S | 9 +++++++++ libc/arch-x86/syscalls/getresuid.S | 9 +++++++++ libc/include/sys/linux-unistd.h | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 2da38b70b..10ef27f4e 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -47,8 +47,8 @@ uid_t getuid:getuid32 () 199 gid_t getgid:getgid32 () 200 uid_t geteuid:geteuid32 () 201 gid_t getegid:getegid32 () 202 -uid_t getresuid:getresuid32 () 209 -gid_t getresgid:getresgid32 () 211 +uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 209 +gid_t getresgid:getresgid32 (gid_t *rgid, gid_t *egid, gid_t *sgid) 211 pid_t gettid() 224 ssize_t readahead(int, off64_t, size_t) 225 int getgroups:getgroups32(int, gid_t *) 205 diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S index 454d32b33..d43aec408 100644 --- a/libc/arch-x86/syscalls/getresgid.S +++ b/libc/arch-x86/syscalls/getresgid.S @@ -7,6 +7,12 @@ .align 4 getresgid: + pushl %ebx + pushl %ecx + pushl %edx + mov 16(%esp), %ebx + mov 20(%esp), %ecx + mov 24(%esp), %edx movl $__NR_getresgid32, %eax int $0x80 cmpl $-129, %eax @@ -17,4 +23,7 @@ getresgid: addl $4, %esp orl $-1, %eax 1: + popl %edx + popl %ecx + popl %ebx ret diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S index f07b5c529..f489d406a 100644 --- a/libc/arch-x86/syscalls/getresuid.S +++ b/libc/arch-x86/syscalls/getresuid.S @@ -7,6 +7,12 @@ .align 4 getresuid: + pushl %ebx + pushl %ecx + pushl %edx + mov 16(%esp), %ebx + mov 20(%esp), %ecx + mov 24(%esp), %edx movl $__NR_getresuid32, %eax int $0x80 cmpl $-129, %eax @@ -17,4 +23,7 @@ getresuid: addl $4, %esp orl $-1, %eax 1: + popl %edx + popl %ecx + popl %ebx ret diff --git a/libc/include/sys/linux-unistd.h b/libc/include/sys/linux-unistd.h index d945d87b4..84ea7c340 100644 --- a/libc/include/sys/linux-unistd.h +++ b/libc/include/sys/linux-unistd.h @@ -17,8 +17,8 @@ uid_t getuid (void); gid_t getgid (void); uid_t geteuid (void); gid_t getegid (void); -uid_t getresuid (void); -gid_t getresgid (void); +uid_t getresuid (uid_t *ruid, uid_t *euid, uid_t *suid); +gid_t getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid); pid_t gettid (void); ssize_t readahead (int, off64_t, size_t); int getgroups (int, gid_t *);