aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/executor/common.h b/executor/common.h
index 6cb7635f0..980ea74b7 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -23,8 +23,15 @@
#endif
#if defined(SYZ_EXECUTOR)
-#ifndef SYSCALLAPI
+#if defined(__GNUC__)
#define SYSCALLAPI
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED(N) __attribute__((aligned(N)))
+#else
+// Assuming windows/cl.
+#define SYSCALLAPI WINAPI
+#define NORETURN __declspec(noreturn)
+#define ALIGNED(N) __declspec(align(N))
#endif
typedef long(SYSCALLAPI* syscall_t)(long, long, long, long, long, long, long, long, long);
@@ -58,7 +65,6 @@ const int kErrorStatus = 68;
NORETURN static void fail(const char* msg, ...)
{
int e = errno;
- fflush(stdout);
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);
@@ -74,7 +80,6 @@ NORETURN static void fail(const char* msg, ...)
// kernel error (e.g. wrong syscall return value)
NORETURN static void error(const char* msg, ...)
{
- fflush(stdout);
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);
@@ -84,12 +89,11 @@ NORETURN static void error(const char* msg, ...)
}
#endif
-#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT))
+#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT) && defined(SYZ_USE_TMP_DIR))
// just exit (e.g. due to temporal ENOMEM error)
NORETURN static void exitf(const char* msg, ...)
{
int e = errno;
- fflush(stdout);
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);