tools/nolibc: add getuid() and geteuid()
authorWilly Tarreau <w@1wt.eu>
Sat, 4 Mar 2023 14:28:40 +0000 (15:28 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 20 Mar 2023 15:45:22 +0000 (08:45 -0700)
commit919d0532d48ca1bea62bc04f269b9e72706467c6
tree2ecc98176b90d1d143a3be6ffa388bcc27f8efed
parentd1209597ff00b6a3c80e37089f7139d0774034bd
tools/nolibc: add getuid() and geteuid()

This can be useful to avoid attempting some privileged operations,
starting from the nolibc-test tool that gets two failures when not
privileged.

We call getuid32() and geteuid32() when they are defined, and fall
back to getuid() and geteuid() otherwise.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/sys.h