From owner-svn-src-head@freebsd.org Fri Jun 2 22:35:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DCD5AFC725; Fri, 2 Jun 2017 22:35:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A20A792FD; Fri, 2 Jun 2017 22:35:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52MZIYj072442; Fri, 2 Jun 2017 22:35:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52MZI2b072440; Fri, 2 Jun 2017 22:35:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201706022235.v52MZI2b072440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Jun 2017 22:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319509 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 22:35:19 -0000 Author: jhb Date: Fri Jun 2 22:35:18 2017 New Revision: 319509 URL: https://svnweb.freebsd.org/changeset/base/319509 Log: Decode the argument passed to cap_getmode(). The returned integer value is output. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Fri Jun 2 20:25:25 2017 (r319508) +++ head/usr.bin/truss/syscall.h Fri Jun 2 22:35:18 2017 (r319509) @@ -48,7 +48,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, - Sockoptname, Msgflags, CapRights, + Sockoptname, Msgflags, CapRights, PUInt, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Jun 2 20:25:25 2017 (r319508) +++ head/usr.bin/truss/syscalls.c Fri Jun 2 22:35:18 2017 (r319509) @@ -99,6 +99,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, + { .name = "cap_getmode", .ret_type = 1, .nargs = 1, + .args = { { PUInt | OUT, 0 } } }, { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, @@ -1190,6 +1192,16 @@ print_arg(struct syscall_args *sc, unsigned long *args case UInt: fprintf(fp, "%u", (unsigned int)args[sc->offset]); break; + case PUInt: { + unsigned int val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ %u }", val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case LongHex: fprintf(fp, "0x%lx", args[sc->offset]); break;