| // Copyright 2017 syzkaller project authors. All rights reserved. |
| // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. |
| |
| // This file is shared between executor and csource package. |
| |
| #include <windows.h> |
| |
| #if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT)) || \ |
| defined(SYZ_USE_TMP_DIR) || defined(SYZ_HANDLE_SEGV) || defined(SYZ_TUN_ENABLE) || \ |
| defined(SYZ_SANDBOX_NAMESPACE) || defined(SYZ_SANDBOX_SETUID) || \ |
| defined(SYZ_SANDBOX_NONE) || defined(SYZ_FAULT_INJECTION) || defined(__NR_syz_kvm_setup_cpu) |
| __attribute__((noreturn)) static void doexit(int status) |
| { |
| _exit(status); |
| for (;;) { |
| } |
| } |
| #endif |
| |
| #include "common.h" |
| |
| #if defined(SYZ_EXECUTOR) || defined(SYZ_HANDLE_SEGV) |
| static void install_segv_handler() |
| { |
| } |
| |
| // TODO(dvyukov): implement me |
| #define NONFAILING(...) \ |
| __try { \ |
| __VA_ARGS__; \ |
| } __except (EXCEPTION_EXECUTE_HANDLER) { \ |
| } |
| #endif |
| |
| #if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT)) |
| static uint64 current_time_ms() |
| { |
| return GetTickCount64(); |
| } |
| #endif |
| |
| #if defined(SYZ_EXECUTOR) |
| static void sleep_ms(uint64 ms) |
| { |
| Sleep(ms); |
| } |
| #endif |
| |
| #if defined(SYZ_EXECUTOR) || defined(SYZ_FAULT_INJECTION) |
| static int inject_fault(int nth) |
| { |
| return 0; |
| } |
| |
| static int fault_injected(int fail_fd) |
| { |
| return 0; |
| } |
| #endif |