From owner-p4-projects Wed Jan 8 10:56:38 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9F6DF37B405; Wed, 8 Jan 2003 10:56:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E91237B401 for ; Wed, 8 Jan 2003 10:56:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0177443E4A for ; Wed, 8 Jan 2003 10:56:35 -0800 (PST) (envelope-from green@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h08IuYfh003800 for ; Wed, 8 Jan 2003 10:56:34 -0800 (PST) (envelope-from green@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h08IuY9G003797 for perforce@freebsd.org; Wed, 8 Jan 2003 10:56:34 -0800 (PST) Date: Wed, 8 Jan 2003 10:56:34 -0800 (PST) Message-Id: <200301081856.h08IuY9G003797@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to green@freebsd.org using -f From: Brian Feldman Subject: PERFORCE change 23436 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=23436 Change 23436 by green@green_laptop_2 on 2003/01/08 10:56:25 Print out more info in truss(1) for sysctl(2) calls. Affected files ... .. //depot/projects/trustedbsd/mac/usr.bin/truss/syscall.h#4 edit .. //depot/projects/trustedbsd/mac/usr.bin/truss/syscalls.c#8 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.bin/truss/syscall.h#4 (text+ko) ==== @@ -22,7 +22,7 @@ */ enum Argtype { None = 1, Hex, Octal, Int, String, Ptr, Stat, Ioctl, Quad, - Signal, Sockaddr, StringArray }; + Signal, Sockaddr, StringArray, HexArray }; #define ARG_MASK 0xff #define OUT 0x100 ==== //depot/projects/trustedbsd/mac/usr.bin/truss/syscalls.c#8 (text+ko) ==== @@ -108,6 +108,9 @@ { { String | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, { "linux_execve", 1, 3, { { String | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, + { "__sysctl", 1, 6, + { { HexArray | IN, 0 }, { Int, 1 }, { Ptr | IN, 2 }, { Ptr | IN, 3 }, + { Ptr | OUT, 4 }, { Int, 5 } } }, { 0, 0, 0, { { 0, 0 }}}, }; @@ -241,6 +244,33 @@ tmp = malloc(12); sprintf(tmp, "%ld", args[sc->offset]); break; + case HexArray: + { + char *old; + int num, i, *ary; + + num = (int)args[sc[1].offset]; + if (num <= 0) { + asprintf(&tmp, "[]"); + break; + } + ary = malloc(sizeof(int) * num); + if (get_struct(fd, (void *)args[sc->offset], (void *)ary, + sizeof(int) * num) == -1) { + err(1, "get_struct %p", (void *)args[sc->offset]); + } + asprintf(&tmp, "[%#lx", ((int *)args[sc->offset])[0]); + for (i = 1; i < num; i++) { + old = tmp; + asprintf(&tmp, "%s, %#lx", old, ary[i]); + free(old); + } + old = tmp; + asprintf(&tmp, "%s]", old); + free(old); + free(ary); + } + break; case String: { char *tmp2; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message