diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/Makefile | 1 | ||||
-rw-r--r-- | posix/Versions | 7 | ||||
-rw-r--r-- | posix/unistd.h | 18 |
3 files changed, 26 insertions, 0 deletions
diff --git a/posix/Makefile b/posix/Makefile index aebd8b3b4b..ede9d1fa1d 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -45,6 +45,7 @@ routines := \ getpid getppid \ getuid geteuid getgid getegid getgroups setuid setgid group_member \ getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \ + getresuid getresgid setresuid setresgid \ getlogin getlogin_r setlogin \ pathconf sysconf fpathconf \ glob glob64 fnmatch regex \ diff --git a/posix/Versions b/posix/Versions index a5378d1d38..d20e552d11 100644 --- a/posix/Versions +++ b/posix/Versions @@ -109,6 +109,13 @@ libc { # For syscall wrapper __nanosleep; } + GLIBC_2.3.2 { + # Note that these symbols appear in sysdeps/unix/sysv/linux/Versions + # under GLIBC_2.0; the first instance in the script is taken as the + # default, so linux configurations put them in GLIBC_2.0 while other + # configuration put them in GLIBC_2.3.2. + getresuid; getresgid; setresuid; setresgid; + } GLIBC_PRIVATE { # functions which have an additional interface since they are # are cancelable. diff --git a/posix/unistd.h b/posix/unistd.h index 792c80af33..9c27c84ed0 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -640,6 +640,24 @@ extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW; extern int setegid (__gid_t __gid) __THROW; #endif /* Use BSD. */ +#ifdef __USE_GNU +/* Fetch the effective user ID, real user ID, and saved-set user ID, + of the calling process. */ +extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); + +/* Fetch the effective group ID, real group ID, and saved-set group ID, + of the calling process. */ +extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); + +/* Set the effective user ID, real user ID, and saved-set user ID, + of the calling process to EUID, RUID, and SUID, respectively. */ +extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); + +/* Set the effective group ID, real group ID, and saved-set group ID, + of the calling process to EGID, RGID, and SGID, respectively. */ +extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); +#endif + /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, |