summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/c.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index b0670dcaa..c8bcb375b 100644
--- a/include/c.h
+++ b/include/c.h
@@ -216,6 +216,12 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...)
exit(eval); \
})
+/* After failed execvp() */
+#define EX_EXEC_FAILED 126 /* Program located, but not usable. */
+#define EX_EXEC_ENOENT 127 /* Could not find program to exec. */
+#define errexec(name) err(errno == ENOENT ? EX_EXEC_ENOENT : EX_EXEC_FAILED, \
+ _("failed to execute %s"), name)
+
static inline __attribute__((const)) int is_power_of_2(unsigned long num)
{