=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/kdump.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/kdump/kdump.c 1995/10/18 08:45:27 1.1 +++ src/usr.bin/kdump/kdump.c 1996/05/24 09:19:34 1.2 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #endif -static char *rcsid = "$NetBSD: kdump.c,v 1.12 1995/08/31 23:18:33 jtc Exp $"; +static char *rcsid = "$NetBSD: kdump.c,v 1.13 1996/05/13 21:12:25 christos Exp $"; #endif /* not lint */ #include @@ -278,7 +278,26 @@ (void)printf("%s ", type); } +void +ioctldecode(cmd) + u_long cmd; +{ + char dirbuf[4], *dir = dirbuf; + if (cmd & IOC_OUT) + *dir++ = 'W'; + if (cmd & IOC_IN) + *dir++ = 'R'; + *dir = '\0'; + + printf(decimal ? ",_IO%s('%c',%ld" : ",_IO%s('%c',%#lx", + dirbuf, (cmd >> 8) & 0xff, cmd & 0xff); + if ((cmd & IOC_VOID) == 0) + printf(decimal ? ",%ld)" : ",%#lx)", (cmd >> 16) & 0xff); + else + printf(")"); +} + ktrsyscall(ktr) register struct ktr_syscall *ktr; { @@ -304,14 +323,8 @@ argsize -= sizeof(register_t); if ((cp = ioctlname(*ap)) != NULL) (void)printf(",%s", cp); - else { - if (decimal) - (void)printf(",%ld", - (long)*ap); - else - (void)printf(",%#lx ", - (long)*ap); - } + else + ioctldecode(*ap); c = ','; ap++; argsize -= sizeof(register_t);