diff options
author | Uwe Stuehler <uwe@cvs.openbsd.org> | 2006-03-26 20:15:51 +0000 |
---|---|---|
committer | Uwe Stuehler <uwe@cvs.openbsd.org> | 2006-03-26 20:15:51 +0000 |
commit | 451027a5515cb6c06d9cbd9d766be3a4d72bde95 (patch) | |
tree | 463c8ea1908787674b9f73eee68821ad27c0e597 /usr.sbin/pstat | |
parent | 428c2242f94df0fa3fd6c7ae2ef52e3860b06a05 (diff) |
Pretty-print addresses on 64-bit architectures; with input and ok deraadt@
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r-- | usr.sbin/pstat/pstat.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index a17e15692e4..8f7f4903603 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pstat.c,v 1.60 2006/03/26 16:49:17 uwe Exp $ */ +/* $OpenBSD: pstat.c,v 1.61 2006/03/26 20:15:50 uwe Exp $ */ /* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94"; #else -static char *rcsid = "$OpenBSD: pstat.c,v 1.60 2006/03/26 16:49:17 uwe Exp $"; +static char *rcsid = "$OpenBSD: pstat.c,v 1.61 2006/03/26 20:15:50 uwe Exp $"; #endif #endif /* not lint */ @@ -277,7 +277,7 @@ vnodemode(void) void vnode_header(void) { - (void)printf("ADDR TYP VFLAG USE HOLD"); + (void)printf("%*s TYP VFLAG USE HOLD", 2 * sizeof(long), "ADDR"); } void @@ -341,7 +341,7 @@ vnode_print(struct vnode *avnode, struct vnode *vp) if (flag == 0) *fp++ = '-'; *fp = '\0'; - (void)printf("%8lx %s %5s %4d %4u", + (void)printf("%0*lx %s %5s %4d %4u", 2 * sizeof(long), (long)avnode, type, flags, vp->v_usecount, vp->v_holdcnt); } @@ -918,12 +918,12 @@ filemode(void) (void)printf("%d/%d open files\n", nfile, maxfile); (void)printf("%*s TYPE FLG CNT MSG %*s OFFSET\n", - 8, "LOC", 8, "DATA"); + 2 * sizeof(long), "LOC", 2 * sizeof(long), "DATA"); for (; (char *)ffp < buf + len; addr = LIST_NEXT(ffp, f_list), ffp++) { memmove(&fp, ffp, sizeof fp); if ((unsigned)fp.f_type > DTYPE_SOCKET) continue; - (void)printf("%lx ", (long)addr); + (void)printf("%0*lx ", 2 * sizeof(long), (long)addr); (void)printf("%-8.8s", dtypes[fp.f_type]); fbp = flagbuf; if (fp.f_flag & FREAD) @@ -939,7 +939,7 @@ filemode(void) *fbp = '\0'; (void)printf("%6s %3ld", flagbuf, fp.f_count); (void)printf(" %3ld", fp.f_msgcount); - (void)printf(" %8.1lx", (long)fp.f_data); + (void)printf(" %0*lx", 2 * sizeof(long), (long)fp.f_data); if (fp.f_offset < 0) (void)printf(" %llx\n", (long long)fp.f_offset); |