summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-01-02 10:00:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:19 +0100
commit910fdea2a904cf17afc8ec0bcb1869b647acbb5e (patch)
treeaa6a336241092443ce933a2353daab62ffbf91c0 /compat
parent869ef11f077af440d23d0b65c83a64a9c4ca85c1 (diff)
compat/sysexits: add win32 polyfill
Diffstat (limited to 'compat')
-rw-r--r--compat/sysexits.hpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/compat/sysexits.hpp b/compat/sysexits.hpp
index 33f19b9d..6747fc88 100644
--- a/compat/sysexits.hpp
+++ b/compat/sysexits.hpp
@@ -2,13 +2,27 @@
#include <cstdlib> // for EXIT_SUCCESS, EXIT_FAILRUE
-/* FreeBSD sysexits(3)
- *
- * The input data was incorrect in some way. This
- * should only be used for user's data and not system
- * files.
- */
-
-#if !defined EX_OSFILE
-# define EX_OSFILE 72
+#ifndef _WIN32
+# include <sysexits.h>
+#else
+// this conforms to BSD sysexits(3)
+// reference the manual page on FreeBSD or Linux for semantics
+# define EX_OK 0
+# define EX_USAGE 64
+# define EX_DATAERR 65
+# define EX_NOINPUT 66
+# define EX_NOUSER 67
+# define EX_NOHOST 68
+# define EX_UNAVAILABLE 69
+# define EX_SOFTWARE 70
+# define EX_OSERR 71
+# define EX_OSFILE 72
+# define EX_CANTCREAT 73
+# define EX_IOERR 74
+# define EX_TEMPFAIL 75
+# define EX_PROTOCOL 76
+# define EX_NOPERM 77
+# define EX_CONFIG 78
#endif
+
+