nolibc/stdlib: Implement `getauxval(3)` function
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>
Tue, 10 Jan 2023 07:24:32 +0000 (08:24 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 10 Jan 2023 21:33:56 +0000 (13:33 -0800)
commitc61a078015f325fe38a7371ab0b12d4444f5fba4
tree13287b45acc2399e6205a901dee64096883ec396
parent241c4b4e02f25ceab21df8a28e1ac689a477c30c
nolibc/stdlib: Implement `getauxval(3)` function

Previous commits save the address of the auxiliary vector into a global
variable @_auxv. This commit creates a new function 'getauxval()' as a
helper function to get the auxv value based on the given key.

The behavior of this function is identic with the function documented
in 'man 3 getauxval'. This function is also needed to implement
'getpagesize()' function that we will wire up in the next patches.

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