Add scandirat(3); from freebsd
authorflorian <florian@openbsd.org>
Mon, 15 Apr 2024 15:47:58 +0000 (15:47 +0000)
committerflorian <florian@openbsd.org>
Mon, 15 Apr 2024 15:47:58 +0000 (15:47 +0000)
commitb5a3756551f8632b5b3b3fe02a1e2d8a7c2fc442
tree93aafdad2c746e7ed94d781ebf5bfbed5b06aa26
parente282ca66dce123bc081c0956f6f6fe46f05b2669
Add scandirat(3); from freebsd

To be used in httpd(8) shortly to prevent toctu issues.

This makes __fdopendir internally accessible to avoid unnecessary
syscalls in scandirat(3). Suggested & diff by guenther

suggested by & OK millert
tweak & OK guenther
OK tb, jca

This rides the libc crank.
include/dirent.h
lib/libc/Symbols.list
lib/libc/gen/opendir.c
lib/libc/gen/scandir.3
lib/libc/gen/scandir.c
lib/libc/hidden/dirent.h