From owner-freebsd-bugs@FreeBSD.ORG Sat Feb 23 12:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8240A16A40B for ; Sat, 23 Feb 2008 12:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 647BC13C45E for ; Sat, 23 Feb 2008 12:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1NCK3pA091044 for ; Sat, 23 Feb 2008 12:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1NCK3p2091037; Sat, 23 Feb 2008 12:20:03 GMT (envelope-from gnats) Date: Sat, 23 Feb 2008 12:20:03 GMT Message-Id: <200802231220.m1NCK3p2091037@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: bin/120870: truss(1) shows 'pipe' system call as having 6 arguments when it only has one X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2008 12:20:03 -0000 The following reply was made to PR bin/120870; it has been noted by GNATS. From: Jaakko Heinonen To: bug-followup@FreeBSD.org, yuri@tsoft.com Cc: alfred@FreeBSD.org Subject: Re: bin/120870: truss(1) shows 'pipe' system call as having 6 arguments when it only has one Date: Sat, 23 Feb 2008 14:12:23 +0200 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, The following patch fixes truss output for geteuid, getpid, getuid and pipe system calls for me. (Tested on i386 only.) The pipe case probably needs a better fix because the special case is handled only in i386-fbsd.c. (alfred@ cc'd because you are listed in src/MAINTAINERS for truss.) -- Jaakko --BOKacYhQ+x31HxR3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="truss-arguments.diff" Index: i386-fbsd.c =================================================================== RCS file: /home/ncvs/src/usr.bin/truss/i386-fbsd.c,v retrieving revision 1.29 diff -u -r1.29 i386-fbsd.c --- i386-fbsd.c 28 Jul 2007 23:15:04 -0000 1.29 +++ i386-fbsd.c 23 Feb 2008 12:05:34 -0000 @@ -309,10 +309,8 @@ /* * The pipe syscall returns its fds in two registers and has assembly glue * to provide the libc API, so it cannot be handled like regular syscalls. - * The nargs check is so we don't have to do yet another strcmp on every - * syscall. */ - if (!errorp && fsc.nargs == 0 && fsc.name && strcmp(fsc.name, "pipe") == 0) { + if (!errorp && fsc.name && strcmp(fsc.name, "pipe") == 0) { fsc.nargs = 1; fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); asprintf(&fsc.s_args[0], "[%d,%d]", (int)retval, regs.r_edx); Index: syscalls.c =================================================================== RCS file: /home/ncvs/src/usr.bin/truss/syscalls.c,v retrieving revision 1.56 diff -u -r1.56 syscalls.c --- syscalls.c 3 Jan 2008 00:18:03 -0000 1.56 +++ syscalls.c 23 Feb 2008 12:05:35 -0000 @@ -93,6 +93,12 @@ struct syscall syscalls[] = { { "fcntl", 1, 3, { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 }}}, + { "geteuid", 1, 0, + { { None, 0 }}}, + { "getpid", 1, 0, + { { None, 0 }}}, + { "getuid", 1, 0, + { { None, 0 }}}, { "readlink", 1, 3, { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 }}}, { "lseek", 2, 3, --BOKacYhQ+x31HxR3--