diff options
Diffstat (limited to 'src/posix_extras.cc')
-rw-r--r-- | src/posix_extras.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/posix_extras.cc b/src/posix_extras.cc index 359240f..f8274fb 100644 --- a/src/posix_extras.cc +++ b/src/posix_extras.cc @@ -75,6 +75,17 @@ struct stat File::LinkStatAt(const char* const path) const { return result; } +void File::MkNod(const char* const path, const mode_t mode, + const dev_t dev) const { + if (path[0] == '/') { + throw std::invalid_argument("absolute path"); + } + + if (mknodat(fd_, path, mode, dev) == -1) { + throw SystemError(); + } +} + File File::OpenAt(const char* const path, const int flags, const mode_t mode) const { if (path[0] == '/') { |