mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-05 06:10:10 -05:00
restructure readdir, add readdir_plus
Does not enable READDIR_AUTO. Might add in the future.
This commit is contained in:
parent
10e8bd9fa3
commit
d119807adb
29 changed files with 1081 additions and 364 deletions
53
src/fs_base_fstatat.hpp
Normal file
53
src/fs_base_fstatat.hpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2019, Antonio SJ Musumeci <trapexit@spawn.link>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
namespace fs
|
||||
{
|
||||
static
|
||||
inline
|
||||
int
|
||||
fstatat(const int dirfd,
|
||||
const char *pathname,
|
||||
struct stat *statbuf,
|
||||
const int flags)
|
||||
{
|
||||
return ::fstatat(dirfd,
|
||||
pathname,
|
||||
statbuf,
|
||||
flags);
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
int
|
||||
fstatat_nofollow(const int dirfd,
|
||||
const char *pathname,
|
||||
struct stat *statbuf)
|
||||
{
|
||||
return fs::fstatat(dirfd,
|
||||
pathname,
|
||||
statbuf,
|
||||
AT_SYMLINK_NOFOLLOW);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue