From b868d1c2d447b2336bf915ad34cc17869f324b69 Mon Sep 17 00:00:00 2001 From: reinoud Date: Mon, 12 Dec 2011 19:59:21 +0000 Subject: [PATCH] Elaborate return value printing to include JUSTRETURN etc. instead of reporting it as an error! --- sys/arch/usermode/usermode/syscall.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/arch/usermode/usermode/syscall.c b/sys/arch/usermode/usermode/syscall.c index 65b07dc25413..17e8e47359c3 100644 --- a/sys/arch/usermode/usermode/syscall.c +++ b/sys/arch/usermode/usermode/syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.16 2011/12/12 15:05:36 reinoud Exp $ */ +/* $NetBSD: syscall.c,v 1.17 2011/12/12 19:59:21 reinoud Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.16 2011/12/12 15:05:36 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.17 2011/12/12 19:59:21 reinoud Exp $"); #include #include @@ -159,7 +159,7 @@ syscall_args_print(lwp_t *l, int code, int nargs, int argsize, register_t *args) { char **argv, **envp; -//return; +return; if (code != 4) { printf("lwp %p, code %3d, nargs %d, argsize %3d\t%s(", l, code, nargs, argsize, syscallnames[code]); @@ -217,10 +217,21 @@ syscall_args_print(lwp_t *l, int code, int nargs, int argsize, register_t *args) static void syscall_retvals_print(lwp_t *l, lwp_t *clwp, int code, int nargs, register_t *args, int error, register_t *rval) { -//return; + char const *errstr; + +return; + switch (error) { + case EJUSTRETURN: + errstr = "EJUSTRETURN"; + break; + case EAGAIN: + errstr = "EGAIN"; + break; + default: + errstr = "OK"; + } if (code != 4) - printf("=> %s%s: %d, (%"PRIx32", %"PRIx32")\n", - (l != clwp)?"(FORKED) ":"", error?"ERROR":"OK", - error, (uint) (rval[0]), (uint) (rval[1])); + printf("=> %s: %d, (%"PRIx32", %"PRIx32")\n", + errstr, error, (uint) (rval[0]), (uint) (rval[1])); }