From 7f1562fbf9262270b31d1007e400dd6605d81f99 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 1 May 2016 18:56:11 -0700 Subject: Adding getresuid, getresuid, getresgid and setresgid. * configure: Test for these functions. * sysif.c (getresuid_wrap, getresgid_wrap, setresuid_wrap, setresgid_wrap): New static function. (sysif_init): Registered getresuid, setresgid, setresuid and setresgid intrinsics. * txr.1: Documented all four functions. --- configure | 26 ++++++++++++++++++++++++++ sysif.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ txr.1 | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) diff --git a/configure b/configure index e0759ab1..d78b791c 100755 --- a/configure +++ b/configure @@ -2193,6 +2193,32 @@ else printf "no\n" fi +printf "Checking for {set,get}res{uid,gid} ... " + +cat > conftest.c < +#include + +int main(int argc, char **argv) +{ + uid_t ur, ue, us; + gid_t gr, ge, gs; + int gur = getresuid(&ur, &ue, &us); + int ggr = getresgid(&gr, &ge, &gs); + int sur = setresuid(0, 0, 0); + int sgr = setresgid(0, 0, 0); + return 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_SETRESUID 1\n" >> $config_h + have_unistd=y +else + printf "no\n" +fi + printf "Checking for setgroups ... " cat > conftest.c <