Skip to contentSkip to conversation

selftests/futex: skip tests if shmget unsupported

PATCH Applied Carlos Llamas 2 participants 2 messages Oct 16, 2025 – Nov 14, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tools/testing/selftests/futex/functional/futex_wait.c  | 2 ++
 tools/testing/selftests/futex/functional/futex_waitv.c | 2 ++
 2 files changed, 4 insertions(+)
tools/testing/selftests/futex/functional/futex_wait.c +2 -0
index 152ca4612886..1269642bb662 100644
@@ -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);
 	}
tools/testing/selftests/futex/functional/futex_waitv.c +2 -0
index c684b10eb76e..3bc4e5dc70e7 100644
@@ -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);
 		}
Signature · 1 line
2.51.0.869.ge66316f041-goog
merge bot Applied
#1 lore raw

[tip: locking/futex] selftests/futex: Skip tests if shmget unsupported

The following commit has been merged into the locking/futex branch of tip:

The following commit has been merged into the locking/futex branch of tip:

Commit-ID:     275498b88104b36a0f7f913da53dc81c1daed277
Gitweb:        https://git.kernel.org/tip/275498b88104b36a0f7f913da53dc81c1daed277
Author:        Carlos Llamas <[email protected]>
AuthorDate:    Thu, 16 Oct 2025 16:19:41 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 14 Nov 2025 14:39:36 +01:00

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.

---
 tools/testing/selftests/futex/functional/futex_wait.c  | 2 ++
 tools/testing/selftests/futex/functional/futex_waitv.c | 2 ++
 2 files changed, 4 insertions(+)
tools/testing/selftests/futex/functional/futex_wait.c +2 -0
index 4cd87f2..1eb1633 100644
@@ -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);
 	}
tools/testing/selftests/futex/functional/futex_waitv.c +2 -0
index c684b10..3bc4e5d 100644
@@ -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);
 		}