]> granicus.if.org Git - strace/commitdiff
xlat: add SHM_STAT_ANY
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 15 Apr 2018 22:59:56 +0000 (00:59 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 9 May 2018 22:01:45 +0000 (22:01 +0000)
* xlat/shmctl_flags.in (SHM_STAT_ANY): New constant, introduced
by Linux commit v4.17-rc1~52^2~23.
* tests/ipc_shm.c: Check it.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
tests/ipc_shm.c
xlat/shmctl_flags.in

index 0d077d55646bb186ed2c1218c9d1d6b745835b30..f5802cc27f2624bf643da6f6930bc60b3dab44e1 100644 (file)
 # define SHM_HUGE_MASK 0x3f
 #endif
 
+#ifndef SHM_STAT_ANY
+# define SHM_STAT_ANY 15
+#endif
+
 #include "xlat.h"
 #include "xlat/shm_resource_flags.h"
 
@@ -53,6 +57,7 @@
 # define str_ipc_stat "0x2"
 # define str_shm_stat "0xd"
 # define str_shm_info "0xe"
+# define str_shm_stat_any "0xf"
 # define str_ipc_64 "0x100"
 # define str_bogus_cmd "0xdefaced2"
 #elif XLAT_VERBOSE
@@ -66,6 +71,7 @@
 # define str_ipc_stat "0x2 /\\* IPC_STAT \\*/"
 # define str_shm_stat "0xd /\\* SHM_STAT \\*/"
 # define str_shm_info "0xe /\\* SHM_INFO \\*/"
+# define str_shm_stat_any "0xf /\\* SHM_STAT_ANY \\*/"
 # define str_ipc_64 "0x100 /\\* IPC_64 \\*/"
 # define str_bogus_cmd "0xdefaced2 /\\* SHM_\\?\\?\\? \\*/"
 #else
@@ -78,6 +84,7 @@
 # define str_ipc_stat "IPC_STAT"
 # define str_shm_stat "SHM_STAT"
 # define str_shm_info "SHM_INFO"
+# define str_shm_stat_any "SHM_STAT_ANY"
 # define str_ipc_64 "IPC_64"
 # define str_bogus_cmd "0xdefaced2 /\\* SHM_\\?\\?\\? \\*/"
 #endif
@@ -205,5 +212,9 @@ main(void)
        printf("shmctl\\(%d, (%s\\|)?%s, %p\\) = %s\n",
               id, str_ipc_64, str_shm_stat, &ds, sprintrc_grep(rc));
 
+       rc = shmctl(id, SHM_STAT_ANY, &ds);
+       printf("shmctl\\(%d, (%s\\|)?%s, %p\\) = %s\n",
+              id, str_ipc_64, str_shm_stat_any, &ds, sprintrc_grep(rc));
+
        return 0;
 }
index f22e793d41f8529308ed7cd64e0d8598dfa1ed13..55c5c5c2fb02618a22b9d47c8948d35034503b62 100644 (file)
@@ -6,3 +6,4 @@ SHM_LOCK
 SHM_UNLOCK
 SHM_STAT
 SHM_INFO
+SHM_STAT_ANY 15