[PATCH v2 0/4] tools/nolibc: add support for fcntl()

From: Thomas Weißschuh

Date: Wed Dec 02 2026 - 02:30:13 EST




---
Changes in v2:
- Add functional tests.
- Add translations for F_GETLK -> F_GETLK64, etc.
- Make the clang --target= detection more robust.
- Link to v1: https://patch.msgid.link/20261125-nolibc-fcntl-v1-0-503d81db293f@xxxxxxxxxxxxxx

To: Willy Tarreau <w@xxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Cc: Danish Khateeb <danishkhateeb03@xxxxxxxxx>

---
Thomas Weißschuh (4):
tools/nolibc: derive clang target flags from ARCH if CROSS_COMPILE is not set
selftests/nolibc: split out the structure member compatibility checks
tools/nolibc: add support for fcntl()
tools/nolibc: remove the open-coded fcntl() in dup2()

tools/include/nolibc/Makefile | 8 ++
tools/include/nolibc/fcntl.h | 48 +++++++++
tools/include/nolibc/sys.h | 11 +-
tools/include/nolibc/types.h | 15 +++
tools/testing/selftests/nolibc/nolibc-test.c | 150 ++++++++++++++++++++++++---
5 files changed, 212 insertions(+), 20 deletions(-)
---
base-commit: 7f77437e795bbaed6de60fa8b8bf1290eefaa5c9
change-id: 20261023-nolibc-fcntl-0eea08b0f897

Best regards,
--
Thomas Weißschuh <linux@xxxxxxxxxxxxxx>