]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
Remove inclusion of uk/user.h RELEASE-0.10.0
authorMarc Rittinghaus <marc.rittinghaus@kit.edu>
Thu, 11 Aug 2022 06:50:01 +0000 (08:50 +0200)
committerUnikraft <monkey@unikraft.io>
Fri, 19 Aug 2022 08:24:27 +0000 (08:24 +0000)
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

include/sys/unistd.h

index e4c28c1510ee45785a3d395e5fa63aa414d7efe3..05403b133d335bfd502d1ab5e5eb4d285a5bffec 100644 (file)
 /* 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__ */