]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/nolibc: add support for directory access
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Sun, 9 Feb 2025 13:25:46 +0000 (14:25 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 9 Feb 2025 15:46:50 +0000 (16:46 +0100)
commit665fa8dea90d9fbc0e7137c7e1315d6f7e15757e
treedbf986c1f561e2c0d4bea872c539d4702d34ded4
parentdde5625d4d75787a59e95f4d7d6983714bfc14c7
tools/nolibc: add support for directory access

Add an implementation for directory access operations.
To keep nolibc itself allocation-free, a "DIR *" does not point to any
data, but directly encodes a filedescriptor number, equivalent to "FILE *".
Without any per-directory storage it is not possible to implement
readdir() POSIX confirming. Instead only readdir_r() is provided.
While readdir_r() is deprecated in glibc, the reasons for that are
not applicable to nolibc.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/r/20250209-nolibc-dir-v2-2-57cc1da8558b@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/Makefile
tools/include/nolibc/dirent.h [new file with mode: 0644]
tools/include/nolibc/nolibc.h
tools/testing/selftests/nolibc/nolibc-test.c