Don't truncate syscall return values on LP64 platforms.
This commit is contained in:
parent
3ad1ac1cf6
commit
2d720e5ff0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ktrace.h,v 1.17 1999/04/11 18:44:00 kleink Exp $ */
|
||||
/* $NetBSD: ktrace.h,v 1.18 1999/08/06 00:11:02 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -94,7 +94,7 @@ struct ktr_sysret {
|
||||
short ktr_code;
|
||||
short ktr_eosys; /* XXX unused */
|
||||
int ktr_error;
|
||||
int ktr_retval;
|
||||
register_t ktr_retval;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kdump.c,v 1.23 1998/10/24 19:04:51 christos Exp $ */
|
||||
/* $NetBSD: kdump.c,v 1.24 1999/08/06 00:11:03 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: kdump.c,v 1.23 1998/10/24 19:04:51 christos Exp $");
|
||||
__RCSID("$NetBSD: kdump.c,v 1.24 1999/08/06 00:11:03 thorpej Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -399,7 +399,7 @@ void
|
||||
ktrsysret(ktr)
|
||||
struct ktr_sysret *ktr;
|
||||
{
|
||||
int ret = ktr->ktr_retval;
|
||||
register_t ret = ktr->ktr_retval;
|
||||
int error = ktr->ktr_error;
|
||||
int code = ktr->ktr_code;
|
||||
|
||||
@ -411,14 +411,14 @@ ktrsysret(ktr)
|
||||
switch (error) {
|
||||
case 0:
|
||||
if (fancy) {
|
||||
(void)printf("%d", ret);
|
||||
(void)printf("%ld", (long)ret);
|
||||
if (ret < 0 || ret > 9)
|
||||
(void)printf("/%#x", ret);
|
||||
(void)printf("/%#lx", (long)ret);
|
||||
} else {
|
||||
if (decimal)
|
||||
(void)printf("%d", ret);
|
||||
(void)printf("%ld", (long)ret);
|
||||
else
|
||||
(void)printf("%#x", ret);
|
||||
(void)printf("%#lx", (long)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dump.c,v 1.5 1999/07/29 01:53:26 enami Exp $ */
|
||||
/* $NetBSD: dump.c,v 1.6 1999/08/06 00:11:03 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
|
||||
#endif
|
||||
__RCSID("$NetBSD: dump.c,v 1.5 1999/07/29 01:53:26 enami Exp $");
|
||||
__RCSID("$NetBSD: dump.c,v 1.6 1999/08/06 00:11:03 thorpej Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -443,7 +443,7 @@ ktrsysret(ktr, buff, buffsz, lenp)
|
||||
int buffsz, *lenp;
|
||||
char *buff;
|
||||
{
|
||||
register int ret = ktr->ktr_retval;
|
||||
register register_t ret = ktr->ktr_retval;
|
||||
register int error = ktr->ktr_error;
|
||||
|
||||
while (*lenp < 50)
|
||||
@ -457,7 +457,7 @@ ktrsysret(ktr, buff, buffsz, lenp)
|
||||
if (error < MAXERRNOS && error >= -2)
|
||||
sprintf(buff + strlen(buff), " %s",errnos[error].name);
|
||||
} else
|
||||
sprintf(buff + *lenp, " = %d", ret);
|
||||
sprintf(buff + *lenp, " = %ld", (long)ret);
|
||||
strcat(buff + *lenp, "\n");
|
||||
*lenp = 0;
|
||||
fputs(buff, stdout);
|
||||
|
Loading…
Reference in New Issue
Block a user