Currently, we include uk/user.h from the core's posix-user library to
declare signatures for get/setresuid and get/setresgid. However,
these definitions should be part of the C library and not Unikraft.
This commit removes the dependency on the uk/user.h header
and moves the function declaration into the unistd.h directly. It also
adds the missing _GNU_SOURCE guard.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #22
/* Use newlib definitions */
#include_next <sys/unistd.h>
-/* Use Unikraft user related definitions */
-#include <uk/user.h>
+#ifdef _GNU_SOURCE
+#define __NEED_uid_t
+#define __NEED_gid_t
+#include <sys/types.h>
+
+int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
+int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+
+int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+#endif /* _GNU_SOURCE */
#endif /* __NEWLIB_GLUE__SYS_UNISTD_H__ */