aboutsummaryrefslogtreecommitdiff
path: root/src/posix_extras.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/posix_extras.h')
-rw-r--r--src/posix_extras.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/posix_extras.h b/src/posix_extras.h
index b9c0f12..001968f 100644
--- a/src/posix_extras.h
+++ b/src/posix_extras.h
@@ -15,6 +15,7 @@
#ifndef POSIX_EXTRAS_H_
#define POSIX_EXTRAS_H_
+#include <cerrno>
#include <stdexcept>
#include <string>
@@ -26,6 +27,8 @@ namespace scoville {
class IoError : public std::runtime_error {
public:
+ IoError() : IoError(errno) {}
+
explicit IoError(const int number)
: std::runtime_error(Message(number)), number_(number) {}