Commit Graph

2 Commits

Author SHA1 Message Date
Craig Small
412f3e8aa4 testsuite: shmget returns an int
Stops the compilier (correctly) complaining:

lib/test_shm.c: In function ‘main’:
lib/test_shm.c:65:23: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
   65 |     printf("SHMID: %llx\n", shm_id);
      |                    ~~~^     ~~~~~~
      |                       |     |
      |                       |     int
      |                       long long unsigned int

shm_id is an int which is what shmget() returns.

Strangely pmap has always scanned this in as a llx even though the maps
"inode" column is the same number that shmget() returns.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-05-03 19:41:00 +10:00
Craig Small
9c5397a941 testsuite: Add check for shared memory
Created a test process test_shm that allocates a shared memory
segment and prints the segment ID. pmap testsuite runs pmap to
check that the segment is found.

The value returned by shmget() is the same value that is printed
in the fifth column /proc/<PID>/maps

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-04-26 22:04:05 +10:00