1 // Copyright 2017 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 // This file is shared between executor and csource package. 5 6 #include <ros/syscall.h> 7 #include <stdlib.h> 8 #include <unistd.h> 9 10 #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE 11 static void loop(); do_sandbox_none(void)12static int do_sandbox_none(void) 13 { 14 loop(); 15 doexit(0); 16 } 17 #endif 18 19 #if SYZ_EXECUTOR || SYZ_REPEAT 20 static void execute_one(); 21 const char* program_name; 22 child()23void child() 24 { 25 #if SYZ_EXECUTOR || SYZ_HANDLE_SEGV 26 install_segv_handler(); 27 #endif 28 #if SYZ_EXECUTOR 29 receive_execute(); 30 close(kInPipeFd); 31 #endif 32 execute_one(); 33 doexit(0); 34 } 35 #endif 36 37 #if SYZ_EXECUTOR 38 #define do_sandbox_setuid() 0 39 #define do_sandbox_namespace() 0 40 #endif 41