summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/truss/syscall.h2
-rw-r--r--usr.bin/truss/syscalls.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index f0b39b468bbf..6c6babb5b241 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -48,7 +48,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Ioctl,
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,
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index f8c1943125ec..f4195642276d 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -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, long *retval,
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;