syscalls/semctl09: Skip libc test if SEM_STAT_ANY not defined
PATCH v2 1/1 syscalls/semctl09: Skip libc test if SEM_STAT_ANY not defined
The libc test variant should run only if system headers define SEM_STAT_ANY. Skip it if we're falling back to the LAPI definition.
Signed-off-by Martin Doucha <[email protected]>
---
Changes since v2:
- move test_info() call before #if to make test output more clear
configure.ac | 1 + testcases/kernel/syscalls/ipc/semctl/semctl09.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)
configure.ac +1 -0
@@ -38,6 +38,7 @@ AC_PREFIX_DEFAULT(/opt/ltp) AC_CHECK_DECLS([IFLA_NET_NS_PID],,,[#include <linux/if_link.h>]) AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include <sys/mman.h>]) AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include <sys/prctl.h>]) +AC_CHECK_DECLS([SEM_STAT_ANY],,,[#include <sys/sem.h>]) AC_CHECK_HEADERS_ONCE([ \ asm/ldt.h \
testcases/kernel/syscalls/ipc/semctl/semctl09.c +6 -1
@@ -185,9 +185,14 @@ static void setup(void) nobody_uid = ltpuser->pw_uid; root_uid =0 ; +test_info (); + +#if !HAVE_DECL_SEM_STAT_ANY +if (tst_variant ==1 ) +tst_brk (TCONF ,"libc does not support semctl(SEM_STAT_ANY)" ); +#endif sem_id =SAFE_SEMGET (IPC_PRIVATE ,2 ,IPC_CREAT |0600 ); -test_info (); }static void cleanup (void )
Signature · 1 line
2.30.2
PATCH v2 1/1 syscalls/semctl09: Skip libc test if SEM_STAT_ANY not defined
Hi Martin,
Quoted 2 lines
The libc test variant should run only if system headers define
SEM_STAT_ANY. Skip it if we're falling back to the LAPI definition.
Thanks a lot, merged (with also Xu Reviewed-by tag).
Kind regards,
Petr