mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-28 23:06:41 +08:00
fs_openat.hpp
This commit is contained in:
parent
ee6831e16a
commit
cfcd73ed4b
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "ghc/filesystem.hpp"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -53,4 +55,19 @@ namespace fs
|
|||||||
|
|
||||||
return ((rv == -1) ? -errno : rv);
|
return ((rv == -1) ? -errno : rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
int
|
||||||
|
openat(const int dirfd_,
|
||||||
|
const char *pathname_,
|
||||||
|
const int flags_,
|
||||||
|
const mode_t mode_)
|
||||||
|
{
|
||||||
|
int rv;
|
||||||
|
|
||||||
|
rv = ::openat(dirfd_,pathname_,flags_,mode_);
|
||||||
|
|
||||||
|
return ((rv == -1) ? -errno : rv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user