This series implements the mkdirat_fd() syscall that was suggested over at the UAPI group kernel feature page [1] with some tests.
Obviously, if we want this we should also implement mknodeat_fd() and symlinkat_fd(), but their implementation can be done quite similar I believe. I have added an unigned int flags like [2] suggests and an example flag that we may want to remove (it right now mainly serves an internal purpose). But it marks where I would want to place the definitions. This has been compiled and tested on x86 only. [2] is a bit confusing here and there, so I hope I have added the proper syscall definitions everywhere where they needs to be added. [1]: https://github.com/uapi-group/kernel-features?tab=readme-ov-file#race-free-creation-and-opening-of-non-file-inodes [2]: https://www.kernel.org/doc/html/latest/process/adding-syscalls.html Jori Koolstra (2): vfs: syscalls: add mkdirat_fd() selftest: add tests for mkdirat_fd() arch/x86/entry/syscalls/syscall_64.tbl | 1 + fs/internal.h | 1 + fs/namei.c | 26 +++- include/linux/fcntl.h | 2 + include/linux/syscalls.h | 2 + include/uapi/asm-generic/fcntl.h | 3 + include/uapi/asm-generic/unistd.h | 5 +- scripts/syscall.tbl | 1 + tools/include/uapi/asm-generic/unistd.h | 5 +- tools/testing/selftests/filesystems/Makefile | 4 +- .../selftests/filesystems/mkdirat_fd_test.c | 139 ++++++++++++++++++ 11 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 tools/testing/selftests/filesystems/mkdirat_fd_test.c -- 2.53.0

