Index: usr.bin/truss/syscall.h =================================================================== --- usr.bin/truss/syscall.h +++ usr.bin/truss/syscall.h @@ -40,6 +40,7 @@ * Int -- normal integer values (file descriptors, for example) * LongHex -- long value that should be printed in hex * Name -- pointer to a NULL-terminated string. + * ShmName -- pointer to a NULL-terminated string, or shm_open's SHM_ANON. * BinString -- pointer to an array of chars, printed via strvisx(). * Ptr -- pointer to some unspecified structure. Just print as hex for now. * Stat -- a pointer to a stat buffer. Prints a couple fields. @@ -146,6 +147,7 @@ IntArray, Iovec, Name, + ShmName, PipeFds, PSig, PQuadHex, Index: usr.bin/truss/syscalls.c =================================================================== --- usr.bin/truss/syscalls.c +++ usr.bin/truss/syscalls.c @@ -44,6 +44,7 @@ #define _WANT_FREEBSD11_KEVENT #include #include +#include #include #include #include @@ -462,7 +463,7 @@ .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 }, { Ptr | IN, 3 }, { Socklent, 4 } } }, { .name = "shm_open", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, + .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "shm_unlink", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "shutdown", .ret_type = 1, .nargs = 2, @@ -1593,6 +1594,13 @@ case Sizet: fprintf(fp, "%zu", (size_t)args[sc->offset]); break; + case ShmName: + /* Handle special SHM_ANON value. */ + if ((char *) args[sc->offset] == SHM_ANON) { + fprintf(fp, "SHM_ANON"); + break; + } + /* Otherwise fall through and display as regular Name. */ case Name: { /* NULL-terminated string. */ char *tmp2;