mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45:45 +02:00
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>
14 lines
245 B
C++
14 lines
245 B
C++
#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);
|
|
}
|
|
|
|
};
|