aboutsummaryrefslogtreecommitdiff
path: root/build/mkdir.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-24 08:54:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-24 08:54:03 +0200
commitcd9a4ea692ba87aa03a80489bf03736e713722c7 (patch)
treeb98abc4442dd3fa55cdb3c37f50da5a210a15126 /build/mkdir.cxx
parentfdb050b4b1b966683ff00dd14b268fe395492358 (diff)
Sort out diagnostics for mkdir
Diffstat (limited to 'build/mkdir.cxx')
-rw-r--r--build/mkdir.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/build/mkdir.cxx b/build/mkdir.cxx
new file mode 100644
index 0000000..1fbab03
--- /dev/null
+++ b/build/mkdir.cxx
@@ -0,0 +1,21 @@
+// file : build/mkdir.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <build/mkdir>
+
+#include <sys/stat.h> // mkdir()
+
+#include <system_error>
+
+using namespace std;
+
+namespace build
+{
+ void
+ mkdir (const path& p, mode_t m)
+ {
+ if (::mkdir (p.string ().c_str (), m) != 0)
+ throw system_error (errno, system_category ());
+ }
+}