mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35: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>
18 lines
341 B
C
18 lines
341 B
C
#ifndef CRUCIBLE_OPENAT2_H
|
|
#define CRUCIBLE_OPENAT2_H
|
|
|
|
#include <linux/openat2.h>
|
|
|
|
#include <fcntl.h>
|
|
#include <sys/syscall.h>
|
|
#include <unistd.h>
|
|
|
|
extern "C" {
|
|
|
|
/// Weak symbol to support libc with no syscall wrapper
|
|
int openat2(int dirfd, const char *pathname, struct open_how *how, size_t size) throw();
|
|
|
|
};
|
|
|
|
#endif // CRUCIBLE_OPENAT2_H
|