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
This commit is contained in:
Kyle Evans 2020-02-19 14:54:33 +00:00
parent c70019dd0a
commit bcca34259c
2 changed files with 7 additions and 0 deletions

View File

@ -122,6 +122,7 @@ enum Argtype {
Rtpriofunc,
RusageWho,
Schedpolicy,
ShmFlags,
Shutdown,
Signal,
Sigprocmask,

View File

@ -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;