Page MenuHomeFreeBSD

Teach truss how to display shm_open(2), shm_unlink(2)
ClosedPublic

Authored by munro_ip9.org on Oct 7 2018, 12:34 PM.

Details

Summary

It's nice to be able to see the path and flags instead of a bunch of numbers.

Test Plan

Unpatched:

$ cat test.c
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>

int main(int argc, char *argv[])
{
    shm_open("/test-shm-segment", O_RDWR | O_CREAT | O_EXCL, 0600);
    shm_unlink("/test-shm-segment");
    return 0;
}
$ cc test.c
$ truss ./a.out 
...
shm_open(0x2002b8,0xa02,0x180)                   = 3 (0x3)
shm_unlink(0x2002b8)                             = 0 (0x0)
...

Patched:

...
shm_open("/test-shm-segment",O_RDWR|O_CREAT|O_EXCL,0600) = 3 (0x3)
shm_unlink("/test-shm-segment")                  = 0 (0x0)
...

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

munro_ip9.org created this revision.Oct 7 2018, 12:34 PM
tuexen accepted this revision.Oct 7 2018, 6:21 PM
This revision is now accepted and ready to land.Oct 7 2018, 6:21 PM
allanjude accepted this revision.Oct 7 2018, 6:26 PM
kib accepted this revision.Oct 7 2018, 6:28 PM
This revision was automatically updated to reflect the committed changes.