The support for decoding shm_open(2) just added in D17457 causes truss to display shmopen("(null"), ...) if you use the special SHM_ANON value as a segment name. Maybe that's OK, but it'd be better to detect that value and show it properly.
Details
Details
$ cat test.c #include <fcntl.h> #include <sys/mman.h> #include <sys/types.h> int main(int argc, char *argv[]) { shm_open(SHM_ANON, O_RDWR | O_CREAT | O_EXCL, 0600); 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
As of r339224 that shows:
shm_open("(null)",O_RDWR|O_CREAT|O_EXCL,0600) = 3 (0x3) shm_open("/test-shm-segment",O_RDWR|O_CREAT|O_EXCL,0600) = 4 (0x4)
With this patch it shows:
shm_open(SHM_ANON,O_RDWR|O_CREAT|O_EXCL,0600) = 3 (0x3) shm_open("/test-shm-segment",O_RDWR|O_CREAT|O_EXCL,0600) = 4 (0x4)
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable