1
0
Mirror von https://github.com/tkuschel/bees.git synchronisiert 2026-06-19 06:57:54 +02:00

openat2: create a weak syscall wrapper for it

openat2 allows closing more TOCTOU holes, but we can only use it when
the kernel supports it.

This should disappear seamlessly when libc implements the function.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
Zygo Blaxell
2025-01-09 01:16:02 -05:00
Ursprung 613ddc3c71
Commit a9b07d7684
3 geänderte Dateien mit 31 neuen und 0 gelöschten Zeilen
+1
Datei anzeigen
@@ -14,6 +14,7 @@ CRUCIBLE_OBJS = \
fs.o \
multilock.o \
ntoa.o \
openat2.o \
path.o \
process.o \
string.o \
+13
Datei anzeigen
@@ -0,0 +1,13 @@
#include "crucible/openat2.h"
extern "C" {
int
__attribute__((weak))
openat2(int const dirfd, const char *const pathname, struct open_how *const how, size_t const size)
throw()
{
return syscall(SYS_openat2, dirfd, pathname, how, size);
}
};