]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/futex: Skip tests if shmget unsupported
authorCarlos Llamas <cmllamas@google.com>
Thu, 16 Oct 2025 16:19:41 +0000 (16:19 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 14 Nov 2025 13:39:36 +0000 (14:39 +0100)
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
tools/testing/selftests/futex/functional/futex_wait.c
tools/testing/selftests/futex/functional/futex_waitv.c

index 4cd87f2a34221c46d4d6bc9de4b4bc22603f59c5..1eb1633e4654e4150adf4a87ebc8fd0e11e2417e 100644 (file)
@@ -71,6 +71,8 @@ TEST(anon_page)
        /* Testing an anon page shared memory */
        shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
        if (shm_id < 0) {
+               if (errno == ENOSYS)
+                       ksft_exit_skip("shmget syscall not supported\n");
                perror("shmget");
                exit(1);
        }
index c684b10eb76e290e35168790a09a9014ad1b6091..3bc4e5dc70e7f9a151eb0494e762c4381e858be4 100644 (file)
@@ -86,6 +86,8 @@ TEST(shared_waitv)
                int shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666);
 
                if (shm_id < 0) {
+                       if (errno == ENOSYS)
+                               ksft_exit_skip("shmget syscall not supported\n");
                        perror("shmget");
                        exit(1);
                }