Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/usermode Elaborate return value printing t...
details: https://anonhg.NetBSD.org/src/rev/62629d7e23b1
branches: trunk
changeset: 771994:62629d7e23b1
user: reinoud <reinoud%NetBSD.org@localhost>
date: Mon Dec 12 19:59:21 2011 +0000
description:
Elaborate return value printing to include JUSTRETURN etc. instead of
reporting it as an error!
diffstat:
sys/arch/usermode/usermode/syscall.c | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diffs (53 lines):
diff -r cf15ecd2d3ac -r 62629d7e23b1 sys/arch/usermode/usermode/syscall.c
--- a/sys/arch/usermode/usermode/syscall.c Mon Dec 12 19:57:12 2011 +0000
+++ b/sys/arch/usermode/usermode/syscall.c Mon Dec 12 19:59:21 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__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 <sys/types.h>
#include <sys/param.h>
@@ -159,7 +159,7 @@
{
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 @@
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]));
}
Home |
Main Index |
Thread Index |
Old Index