[LTP] [PATCH 3/9] syscalls/ipc: shmctl04: Rewrite from scratch.

Petr Vorel pvorel@suse.cz
Tue Jul 28 11:16:40 CEST 2020


Hi Cyril,

> -	/*
> -	 * Create a temporary directory and cd into it.
> -	 * This helps to ensure that a unique msgkey is created.
> -	 * See libs/libltpipc/libipc.c for more information.
> -	 */
> -	tst_tmpdir();
> +	TEST(shmctl(TST_RET, SHM_STAT_ANY, &ds));
Several old distros fail [1] as they miss SHM_STAT_ANY in <bits/shm.h> (added to
glibc in 2.28, to kernel in 4.17).
Of course, it's just enough to add the definition to include/tst_safe_sysv_ipc.h
(or some LAPI file).

Kind regards,
Petr

[1] https://travis-ci.org/github/pevik/ltp/builds/712476731

diff --git include/tst_safe_sysv_ipc.h include/tst_safe_sysv_ipc.h
index 3e0e50e8d..dea85f97c 100644
--- include/tst_safe_sysv_ipc.h
+++ include/tst_safe_sysv_ipc.h
@@ -10,6 +10,10 @@
 #include <sys/msg.h>
 #include <sys/shm.h>
 
+#ifndef SHM_STAT_ANY
+# define SHM_STAT_ANY	15
+#endif
+
 int safe_msgget(const char *file, const int lineno, key_t key, int msgflg);
 #define SAFE_MSGGET(key, msgflg) \
 	safe_msgget(__FILE__, __LINE__, (key), (msgflg))


More information about the ltp mailing list