aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-19 11:06:05 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-19 11:06:05 +0200
commit3704c60135f96c02079274dad1a00b2dc3f846c9 (patch)
treef9694cd29a8bd1773f1e462094d78065d4ce53dd /executor/common.h
parentf26811f08042dfa5aa5463e35fb3ec9e56005dae (diff)
executor: fix build breakages due to doexit
Some standard libraries contain "using ::exit;", which breaks with the current redefinition of exit.
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/executor/common.h b/executor/common.h
index 980ea74b7..b7a0706fd 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -23,6 +23,14 @@
#endif
#if defined(SYZ_EXECUTOR)
+// exit/_exit do not necessary work (e.g. if fuzzer sets seccomp filter that prohibits exit_group).
+// Use doexit instead. We must redefine exit to something that exists in stdlib,
+// because some standard libraries contain "using ::exit;", but has different signature.
+#define exit vsnprintf
+#define _exit vsnprintf
+#endif
+
+#if defined(SYZ_EXECUTOR)
#if defined(__GNUC__)
#define SYSCALLAPI
#define NORETURN __attribute__((noreturn))