Skip to content

Commit 275498b

Browse files
Carlos LlamasKAGA-KOKO
authored andcommitted
selftests/futex: Skip tests if shmget unsupported
On systems where the shmget() syscall is not supported, tests like anon_page and shared_waitv will fail. Skip these tests in such cases to allow the rest of the test suite to run. Signed-off-by: Carlos Llamas <cmllamas@google.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://patch.msgid.link/20251016162009.3270784-1-cmllamas@google.com
1 parent 9407d13 commit 275498b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

tools/testing/selftests/futex/functional/futex_wait.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ TEST(anon_page)
7171
/* Testing an anon page shared memory */
7272
shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
7373
if (shm_id < 0) {
74+
if (errno == ENOSYS)
75+
ksft_exit_skip("shmget syscall not supported\n");
7476
perror("shmget");
7577
exit(1);
7678
}

tools/testing/selftests/futex/functional/futex_waitv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ TEST(shared_waitv)
8686
int shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
8787

8888
if (shm_id < 0) {
89+
if (errno == ENOSYS)
90+
ksft_exit_skip("shmget syscall not supported\n");
8991
perror("shmget");
9092
exit(1);
9193
}

0 commit comments

Comments
 (0)