aboutsummaryrefslogtreecommitdiff
path: root/src/posix_extras.h
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 19:22:01 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 20:38:02 -0500
commit05cafc5002360015a79484e6ee40c159b1c80958 (patch)
tree7443cf8226d198d1fd42540475b2f05bc23e2f28 /src/posix_extras.h
parent08268425d61bd2b08a31d5589a4e7f1a62ac333d (diff)
Replace creat with mknod+open
Performance is not an immediate concern, so replace creat with mknod to compact code.
Diffstat (limited to 'src/posix_extras.h')
-rw-r--r--src/posix_extras.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/posix_extras.h b/src/posix_extras.h
index 9bcbe51..60b2284 100644
--- a/src/posix_extras.h
+++ b/src/posix_extras.h
@@ -66,6 +66,10 @@ class File {
// indeed be relative (i.e., it must not start with '/').
struct stat LinkStatAt(const char* path) const;
+ // Creates a file or directory at the path relative to the file descriptor.
+ // The path must indeed be relative (i.e., it must not start with '/').
+ void MkNod(const char* path, mode_t mode, dev_t dev) const;
+
// Calls openat(2) on the path relative to the file descriptor. The path must
// indeed be relative (i.e., it must not start with '/').
File OpenAt(const char* const path, const int flags) const {