mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-26 09:56:28 -05:00
49 lines
835 B
C++
49 lines
835 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "to_neg_errno.hpp"
|
||
|
|
#include "fs_path.hpp"
|
||
|
|
|
||
|
|
#include <fcntl.h>
|
||
|
|
#include <sys/stat.h>
|
||
|
|
|
||
|
|
namespace fs
|
||
|
|
{
|
||
|
|
static
|
||
|
|
inline
|
||
|
|
int
|
||
|
|
mkdirat(const int dirfd_,
|
||
|
|
const char *pathname_,
|
||
|
|
const mode_t mode_)
|
||
|
|
{
|
||
|
|
int rv;
|
||
|
|
|
||
|
|
rv = ::mkdirat(dirfd_,pathname_,mode_);
|
||
|
|
|
||
|
|
return ::to_neg_errno(rv);
|
||
|
|
}
|
||
|
|
|
||
|
|
static
|
||
|
|
inline
|
||
|
|
int
|
||
|
|
mkdirat(const int dirfd_,
|
||
|
|
const std::string &pathname_,
|
||
|
|
const mode_t mode_)
|
||
|
|
{
|
||
|
|
return fs::mkdirat(dirfd_,
|
||
|
|
pathname_.c_str(),
|
||
|
|
mode_);
|
||
|
|
}
|
||
|
|
|
||
|
|
static
|
||
|
|
inline
|
||
|
|
int
|
||
|
|
mkdirat(const int dirfd_,
|
||
|
|
const fs::path &pathname_,
|
||
|
|
const mode_t mode_)
|
||
|
|
{
|
||
|
|
return fs::mkdirat(dirfd_,
|
||
|
|
pathname_.c_str(),
|
||
|
|
mode_);
|
||
|
|
}
|
||
|
|
}
|