0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-25 21:38:18 +02:00

ircd::fs: Add fd::opts nocreate open() option.

This commit is contained in:
Jason Volk 2018-05-30 04:21:27 -07:00
parent 8395a7844c
commit 45155d5e4d
2 changed files with 2 additions and 0 deletions

View file

@ -49,6 +49,7 @@ struct ircd::fs::fd::opts
bool ate {false};
bool direct {false};
bool cloexec {true};
bool nocreate {false};
opts(const std::ios::open_mode &);
opts() = default;

View file

@ -388,6 +388,7 @@ ircd::fs::fd::fd(const string_view &path,
int flags(opts.flags);
flags |= opts.direct? O_DIRECT : 0U;
flags |= opts.cloexec? O_CLOEXEC : 0U;
flags &= opts.nocreate? ~O_CREAT : flags;
const mode_t &mode(opts.mask);
const char *const &p(path_str(path));