Define O_PATH if not already defined

This commit is contained in:
Chris Burr 2020-12-12 11:41:15 +01:00 committed by Benny Baumann
parent 880eecabf5
commit 8149823d56
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,12 @@ in the source distribution for its full text.
#endif #endif
// CentOS 6's kernel doesn't provide a definition of O_PATH
// based on definition taken from uapi/asm-generic/fcnth.h in Linux kernel tree
#ifndef O_PATH
# define O_PATH 010000000
#endif
static FILE* fopenat(openat_arg_t openatArg, const char* pathname, const char* mode) { static FILE* fopenat(openat_arg_t openatArg, const char* pathname, const char* mode) {
assert(String_eq(mode, "r")); /* only currently supported mode */ assert(String_eq(mode, "r")); /* only currently supported mode */