From 596466b38cd4e2de23df479ffd78dece9966d875 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 6 Sep 2018 10:54:14 +0200 Subject: pkg/runtest: fixes for fuchsia Add simple fuchsia program, the one that is run during image testing. Fix csource errno printing for fuchsia. Fix creation of executable files (chmod is not implemented on fuchsia). Check that we get signal/coverage from all syscalls. --- pkg/csource/csource.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkg/csource/csource.go') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 69be3ff2a..49431f655 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -247,7 +247,13 @@ func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCo } fmt.Fprintf(w, ");\n") if trace { - fmt.Fprintf(w, "\tprintf(\"### call=%v errno=%%u\\n\", res == -1 ? errno : 0);\n", ci) + cast := "" + if !native && !strings.HasPrefix(callName, "syz_") { + // Potentially we casted a function returning int to a function returning long. + // So instead of long -1 we can get 0x00000000ffffffff. Sign extend it to long. + cast = "(long)(int)" + } + fmt.Fprintf(w, "\tprintf(\"### call=%v errno=%%u\\n\", %vres == -1 ? errno : 0);\n", ci, cast) } } -- cgit mrf-deployment