From owner-svn-src-all@freebsd.org Sat Mar 18 18:21:42 2017 Return-Path: Delivered-To: svn-src-all@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 B9C30D12FF6; Sat, 18 Mar 2017 18:21:42 +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 73AF5105D; Sat, 18 Mar 2017 18:21:42 +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 v2IILfJD069568; Sat, 18 Mar 2017 18:21:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2IILfXJ069566; Sat, 18 Mar 2017 18:21:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201703181821.v2IILfXJ069566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Mar 2017 18:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315500 - 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Mar 2017 18:21:42 -0000 Author: jhb Date: Sat Mar 18 18:21:41 2017 New Revision: 315500 URL: https://svnweb.freebsd.org/changeset/base/315500 Log: Decode file flags passed to *chflags*(). While here, decode arguments passed to fchflags() and chflagsat(). 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 Sat Mar 18 18:19:31 2017 (r315499) +++ head/usr.bin/truss/syscall.h Sat Mar 18 18:21:41 2017 (r315500) @@ -45,7 +45,7 @@ enum Argtype { None = 1, Hex, Octal, Int Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, - CapFcntlRights, Fadvice, + CapFcntlRights, Fadvice, FileFlags, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Mar 18 18:19:31 2017 (r315499) +++ head/usr.bin/truss/syscalls.c Sat Mar 18 18:21:41 2017 (r315500) @@ -99,7 +99,10 @@ static struct syscall decoded_syscalls[] { .name = "chdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, - .args = { { Name | IN, 0 }, { Hex, 1 } } }, + .args = { { Name | IN, 0 }, { FileFlags, 1 } } }, + { .name = "chflagsat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { FileFlags, 2 }, + { Atflags, 3 } } }, { .name = "chmod", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "chown", .ret_type = 1, .nargs = 3, @@ -125,6 +128,8 @@ static struct syscall decoded_syscalls[] { .name = "faccessat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, { Atflags, 3 } } }, + { .name = "fchflags", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { FileFlags, 1 } } }, { .name = "fchmod", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Octal, 1 } } }, { .name = "fchmodat", .ret_type = 1, .nargs = 4, @@ -189,7 +194,7 @@ static struct syscall decoded_syscalls[] { .name = "kse_release", .ret_type = 0, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "lchflags", .ret_type = 1, .nargs = 2, - .args = { { Name | IN, 0 }, { Hex, 1 } } }, + .args = { { Name | IN, 0 }, { FileFlags, 1 } } }, { .name = "lchmod", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "lchown", .ret_type = 1, .nargs = 3, @@ -1868,6 +1873,15 @@ print_arg(struct syscall_args *sc, unsig case Fadvice: print_integer_arg(sysdecode_fadvice, fp, args[sc->offset]); break; + case FileFlags: { + fflags_t rem; + + if (!sysdecode_fileflags(fp, args[sc->offset], &rem)) + fprintf(fp, "0x%x", rem); + else if (rem != 0) + fprintf(fp, "|0x%x", rem); + break; + } case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);