Skip to content

tools/nolibc: cleanups, statx(), getuid()

Willy Tarreau lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tools/nolibc: add getuid() and geteuid()tools/include/nolibc/sys.h+42 -00 replies
2/5selftests/nolibc: skip the chroot_root and link_dir tests when not privilegedtools/testing/selftests/nolibc/nolibc-test.c+6 -20 replies
3/5tools/nolibc: check for S_I* macros before defining themtools/include/nolibc/types.h+22 -10 replies
4/5tools/nolibc: Include linux/fcntl.h and remove duplicate codetools/include/nolibc/sys.h tools/include/nolibc/types.h+1 -60 replies
5/5tools/nolibc: Add statx() and make stat() rely on statx() if necessarytools/include/nolibc/sys.h+56 -00 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchHuacai Chen
1/5
2/5
3/5
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] tools/nolibc: cleanups, statx(), getuid()

Hello Paul,

this is the second series of updates for nolibc. The work was started by Feiyang Chen who got rid of some local definitions in favor of inclusion of linux/fcntl.h. Consecutive to this I noticed new issues related to redefinitions of S_IFDIR and friends and figured that it can happen with some compilers that /usr/include is inconditionally checked and causes annoyance around these flags that are defined both in glibc and the kernel. The UAPI includes already have a specific check for this, so the issue was fixed by always including linux/stat.h in types.h and conditionally defining our own flags like UAPI does.

Feiyang also added statx() because loongarch needs it for stat().

Finally I added getuid() and geteuid() so that we can finally skip the two tests that require privileges in "run-user" native tests. Now they appear as "SKIPPED" in the output, and the test is reported as successful since there's no error anymore. I was finding it really annoying to always have to carefully check errors that were expected on success, now that's just bad old memories.

This series applies on top of Vincent's stdint series that was rebased on top of your dev.2023.02.22a branch. Likewise, if it could make it for 2.4 that would be great, especially since the next loongarch series depends on it.

Thanks!
Willy

Feiyang Chen (2):
tools/nolibc: Include linux/fcntl.h and remove duplicate code tools/nolibc: Add statx() and make stat() rely on statx() if necessary

Willy Tarreau (3):
tools/nolibc: add getuid() and geteuid() selftests/nolibc: skip the chroot_root and link_dir tests when not
privileged
tools/nolibc: check for S_I* macros before defining them

 tools/include/nolibc/sys.h                   | 100 ++++++++++++++++++-
 tools/include/nolibc/types.h                 |  28 ++++--
 tools/testing/selftests/nolibc/nolibc-test.c |   8 +-
 3 files changed, 127 insertions(+), 9 deletions(-)
Signature · 1 line
2.17.5