aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_fuchsia.cc
diff options
context:
space:
mode:
Diffstat (limited to 'executor/executor_fuchsia.cc')
-rw-r--r--executor/executor_fuchsia.cc29
1 files changed, 4 insertions, 25 deletions
diff --git a/executor/executor_fuchsia.cc b/executor/executor_fuchsia.cc
index a5aa19470..dd9204d7d 100644
--- a/executor/executor_fuchsia.cc
+++ b/executor/executor_fuchsia.cc
@@ -12,40 +12,19 @@
#include "syscalls_fuchsia.h"
-char input_data[kMaxInput];
uint32_t output;
int main(int argc, char** argv)
{
if (argc == 2 && strcmp(argv[1], "version") == 0) {
- puts("linux " GOARCH " " SYZ_REVISION " " GIT_REVISION);
+ puts(GOOS " " GOARCH " " SYZ_REVISION " " GIT_REVISION);
return 0;
}
install_segv_handler();
- int pos = 0;
- for (;;) {
- int rv = read(0, input_data + pos, sizeof(input_data) - pos);
- if (rv < 0)
- fail("read failed");
- if (rv == 0)
- break;
- pos += rv;
- }
- if (pos < 24)
- fail("truncated input");
-
- uint64_t flags = *(uint64_t*)input_data;
- flag_debug = flags & (1 << 0);
- flag_threaded = flags & (1 << 2);
- flag_collide = flags & (1 << 3);
- if (!flag_threaded)
- flag_collide = false;
- uint64_t executor_pid = *((uint64_t*)input_data + 2);
- debug("input %d, threaded=%d collide=%d pid=%llu\n",
- pos, flag_threaded, flag_collide, executor_pid);
-
- execute_one(((uint64_t*)input_data) + 3);
+ setup_control_pipes();
+ receive_execute();
+ execute_one();
return 0;
}