2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / local-setxid.h
blob0579687982a7c46fd18d1b1d5b65856a76007977
1 /* SETxID functions which only have to change the local thread and
2 none of the possible other threads. */
3 #include <kernel-features.h>
4 #include <sysdep.h>
6 /* If we can use the syscall directly, use it. */
7 #if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
8 # define local_seteuid(id) INLINE_SYSCALL (setresuid32, 3, -1, id, -1)
9 #elif __ASSUME_SETRESUID_SYSCALL > 0
10 # define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1)
11 #else
12 # define local_seteuid(id) seteuid (id)
13 #endif
16 /* If we can use the syscall directly, use it. */
17 #if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
18 # define local_setegid(id) INLINE_SYSCALL (setresgid32, 3, -1, id, -1)
19 #elif __ASSUME_SETRESGID_SYSCALL > 0
20 # define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1)
21 #else
22 # define local_setegid(id) setegid (id)
23 #endif