diff options
author | Elliott Hughes <enh@google.com> | 2014-07-30 23:16:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-07-23 22:55:49 +0000 |
commit | 83b9826e683db30e9b359737253b87ef8b3ba3df (patch) | |
tree | 34a7eec7841aaf4dc12eb33fe6309d078f672819 | |
parent | c7706a02ad90ab73f3a056040d2c4a3464ab1ab1 (diff) | |
parent | 79310994d2b3826a10598f7e7795acb5edb42a20 (diff) | |
download | android_bionic-83b9826e683db30e9b359737253b87ef8b3ba3df.tar.gz android_bionic-83b9826e683db30e9b359737253b87ef8b3ba3df.tar.bz2 android_bionic-83b9826e683db30e9b359737253b87ef8b3ba3df.zip |
Merge "Implement <sys/fsuid.h>."
-rw-r--r-- | libc/SYSCALLS.TXT | 3 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/setfsgid.S | 14 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/setfsuid.S | 14 | ||||
-rw-r--r-- | libc/arch-arm64/syscalls/setfsgid.S | 14 | ||||
-rw-r--r-- | libc/arch-arm64/syscalls/setfsuid.S | 14 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/setfsgid.S | 19 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/setfsuid.S | 19 | ||||
-rw-r--r-- | libc/arch-mips64/syscalls/setfsgid.S | 25 | ||||
-rw-r--r-- | libc/arch-mips64/syscalls/setfsuid.S | 25 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/setfsgid.S | 21 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/setfsuid.S | 21 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls/setfsgid.S | 15 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls/setfsuid.S | 15 | ||||
-rw-r--r-- | libc/include/sys/fsuid.h | 3 |
14 files changed, 220 insertions, 2 deletions
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 014d55444..128ec6bd0 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -303,6 +303,9 @@ int __ppoll:ppoll(pollfd*, unsigned int, timespec*, const sigset_t*, size_t) al int __set_tid_address:set_tid_address(int*) all +int setfsgid(gid_t) all +int setfsuid(uid_t) all + pid_t wait4(pid_t, int*, int, struct rusage*) all int __waitid:waitid(int, pid_t, struct siginfo_t*, int, void*) all diff --git a/libc/arch-arm/syscalls/setfsgid.S b/libc/arch-arm/syscalls/setfsgid.S new file mode 100644 index 000000000..e36e6eac8 --- /dev/null +++ b/libc/arch-arm/syscalls/setfsgid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + mov ip, r7 + ldr r7, =__NR_setfsgid + swi #0 + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno +END(setfsgid) diff --git a/libc/arch-arm/syscalls/setfsuid.S b/libc/arch-arm/syscalls/setfsuid.S new file mode 100644 index 000000000..e3c9c009f --- /dev/null +++ b/libc/arch-arm/syscalls/setfsuid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + mov ip, r7 + ldr r7, =__NR_setfsuid + swi #0 + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno +END(setfsuid) diff --git a/libc/arch-arm64/syscalls/setfsgid.S b/libc/arch-arm64/syscalls/setfsgid.S new file mode 100644 index 000000000..d2f29ab76 --- /dev/null +++ b/libc/arch-arm64/syscalls/setfsgid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + mov x8, __NR_setfsgid + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno + + ret +END(setfsgid) diff --git a/libc/arch-arm64/syscalls/setfsuid.S b/libc/arch-arm64/syscalls/setfsuid.S new file mode 100644 index 000000000..852f97cbe --- /dev/null +++ b/libc/arch-arm64/syscalls/setfsuid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + mov x8, __NR_setfsuid + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno + + ret +END(setfsuid) diff --git a/libc/arch-mips/syscalls/setfsgid.S b/libc/arch-mips/syscalls/setfsgid.S new file mode 100644 index 000000000..6a5956581 --- /dev/null +++ b/libc/arch-mips/syscalls/setfsgid.S @@ -0,0 +1,19 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + .set noreorder + .cpload t9 + li v0, __NR_setfsgid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + la t9,__set_errno + j t9 + nop + .set reorder +END(setfsgid) diff --git a/libc/arch-mips/syscalls/setfsuid.S b/libc/arch-mips/syscalls/setfsuid.S new file mode 100644 index 000000000..1c2317a7b --- /dev/null +++ b/libc/arch-mips/syscalls/setfsuid.S @@ -0,0 +1,19 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + .set noreorder + .cpload t9 + li v0, __NR_setfsuid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + la t9,__set_errno + j t9 + nop + .set reorder +END(setfsuid) diff --git a/libc/arch-mips64/syscalls/setfsgid.S b/libc/arch-mips64/syscalls/setfsgid.S new file mode 100644 index 000000000..7f75ed923 --- /dev/null +++ b/libc/arch-mips64/syscalls/setfsgid.S @@ -0,0 +1,25 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + .set push + .set noreorder + li v0, __NR_setfsgid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno + .cpreturn + j t9 + move ra, t0 + .set pop +END(setfsgid) diff --git a/libc/arch-mips64/syscalls/setfsuid.S b/libc/arch-mips64/syscalls/setfsuid.S new file mode 100644 index 000000000..4cab9d4cb --- /dev/null +++ b/libc/arch-mips64/syscalls/setfsuid.S @@ -0,0 +1,25 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + .set push + .set noreorder + li v0, __NR_setfsuid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno + .cpreturn + j t9 + move ra, t0 + .set pop +END(setfsuid) diff --git a/libc/arch-x86/syscalls/setfsgid.S b/libc/arch-x86/syscalls/setfsgid.S new file mode 100644 index 000000000..fa7a5c59f --- /dev/null +++ b/libc/arch-x86/syscalls/setfsgid.S @@ -0,0 +1,21 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + pushl %ebx + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 + mov 8(%esp), %ebx + movl $__NR_setfsgid, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp +1: + popl %ebx + ret +END(setfsgid) diff --git a/libc/arch-x86/syscalls/setfsuid.S b/libc/arch-x86/syscalls/setfsuid.S new file mode 100644 index 000000000..5856a16e0 --- /dev/null +++ b/libc/arch-x86/syscalls/setfsuid.S @@ -0,0 +1,21 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + pushl %ebx + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 + mov 8(%esp), %ebx + movl $__NR_setfsuid, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp +1: + popl %ebx + ret +END(setfsuid) diff --git a/libc/arch-x86_64/syscalls/setfsgid.S b/libc/arch-x86_64/syscalls/setfsgid.S new file mode 100644 index 000000000..e9f50b80d --- /dev/null +++ b/libc/arch-x86_64/syscalls/setfsgid.S @@ -0,0 +1,15 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsgid) + movl $__NR_setfsgid, %eax + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno +1: + ret +END(setfsgid) diff --git a/libc/arch-x86_64/syscalls/setfsuid.S b/libc/arch-x86_64/syscalls/setfsuid.S new file mode 100644 index 000000000..cfdb86cc8 --- /dev/null +++ b/libc/arch-x86_64/syscalls/setfsuid.S @@ -0,0 +1,15 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include <private/bionic_asm.h> + +ENTRY(setfsuid) + movl $__NR_setfsuid, %eax + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno +1: + ret +END(setfsuid) diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h index bc47e3d95..03355b794 100644 --- a/libc/include/sys/fsuid.h +++ b/libc/include/sys/fsuid.h @@ -25,6 +25,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + #ifndef _SYS_FSUID_H_ #define _SYS_FSUID_H_ @@ -33,10 +34,8 @@ __BEGIN_DECLS -#if 0 /* MISSING FROM BIONIC */ extern int setfsuid(uid_t); extern int setfsgid(gid_t); -#endif /* MISSING */ __END_DECLS |