}
#endif
+#ifdef HAVE_SETREGID
+static int libc_setregid(gid_t rgid, gid_t egid)
+{
+ uwrap_load_lib_function(UWRAP_LIBC, setregid);
+
+ return uwrap.libc.fns._libc_setregid(rgid, egid);
+}
+#endif
+
static void *uwrap_libc_fn(struct uwrap *u, const char *fn_name)
{
void *func;
}
#endif
-#ifdef HAVE_SETREGID
- *(void **) (&u->libc.fns._libc_setregid) = uwrap_libc_fn(u, "setregid");
-#endif
#ifdef HAVE_SETRESGID
*(void **) (&u->libc.fns._libc_setresgid) = uwrap_libc_fn(u, "setresgid");
#endif
int setregid(gid_t rgid, gid_t egid)
{
if (!uwrap_enabled()) {
- return uwrap.libc.fns._libc_setregid(rgid, egid);
+ return libc_setregid(rgid, egid);
}
return uwrap_setresgid(rgid, egid, -1);