From bcca34259c046ca78f574e4c8694d0af0f0d0bec Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 19 Feb 2020 14:54:33 +0000 Subject: [PATCH] truss: decode shm_open2 shm_open2 is similar to shm_open, except it also takes shmflags and optional name to label the anonymous region for, e.g., debugging purposes. The appropriate support for decoding shmflags was added to libsysdecode in r358115. This is a part of D23733. Reviewed by: kaktus --- usr.bin/truss/syscall.h | 1 + usr.bin/truss/syscalls.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 74fbcb7b254..c7094230370 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -122,6 +122,7 @@ enum Argtype { Rtpriofunc, RusageWho, Schedpolicy, + ShmFlags, Shutdown, Signal, Sigprocmask, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 721fbd23f8d..31192b37a52 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -471,6 +471,9 @@ static struct syscall decoded_syscalls[] = { { Ptr | IN, 3 }, { Socklent, 4 } } }, { .name = "shm_open", .ret_type = 1, .nargs = 3, .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, + { .name = "shm_open2", .ret_type = 1, .nargs = 5, + .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 }, + { ShmFlags, 3 }, { BinString | IN, 4 } } }, { .name = "shm_rename", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Name | IN, 1 }, { Hex, 2 } } }, { .name = "shm_unlink", .ret_type = 1, .nargs = 1, @@ -2009,6 +2012,9 @@ print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, case Whence: print_integer_arg(sysdecode_whence, fp, args[sc->offset]); break; + case ShmFlags: + print_mask_arg(sysdecode_shmflags, fp, args[sc->offset]); + break; case Sockdomain: print_integer_arg(sysdecode_socketdomain, fp, args[sc->offset]); break;