From 4ce69996ec362f8dd9762dcc1643d13cebaab44a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 5 Dec 2020 09:00:06 +0100 Subject: sys/linux, sys/freebsd: apply more ignore_return attributes 1. Apply ignore_return to semctl$GETVAL which produces random errno values on linux and freebsd. 2. Apply ignore_return to prctl and remove the custom code in executor. 3. Remove the custom errno ignoring code in fuchsia executor. The calls are already marked as ignore_return, so this is just a leftover. 4. Only reset errno for ignore_return. The syscall can still return a resource (maybe). We only need to reset errno for fallback coverage. --- executor/executor_linux.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'executor/executor_linux.h') diff --git a/executor/executor_linux.h b/executor/executor_linux.h index 8f0dc579a..8c5a19ef7 100644 --- a/executor/executor_linux.h +++ b/executor/executor_linux.h @@ -84,13 +84,7 @@ static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { if (c->call) return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); - intptr_t res = syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5]); - // Some prctl commands don't respect the normal convention for return values - // (e.g. PR_GET_TIMERSLACK, but there are more) and may produce all possible - // errno values. This conflicts with fallback coverage. - if (!flag_coverage && res == -1 && !strcmp(c->name, "prctl")) - errno = EINVAL; - return res; + return syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5]); } static void cover_open(cover_t* cov, bool extra) -- cgit mrf-deployment