tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c- Extension
.c- Size
- 2458 bytes
- Lines
- 94
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
errno.hgetopt.hpthread.hstdio.hstdlib.hstring.htime.hfutextest.hkselftest_harness.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
if (errno == EINVAL) {
/*
* The kernel correctly detected the mismatched
* requeue_pi target and aborted. Wake the child with
* FUTEX_WAKE.
*/
ret = futex_wake(&f1, 1, FUTEX_PRIVATE_FLAG);
if (ret == 1)
ret = 0;
else if (ret < 0)
ksft_exit_fail_msg("futex_wake\n");
else
ksft_exit_fail_msg("futex_wake did not wake the child\n");
} else {
ksft_exit_fail_msg("futex_cmp_requeue_pi\n");
}
} else if (ret > 0) {
ksft_test_result_fail("futex_cmp_requeue_pi failed to detect the mismatch\n");
} else {
ksft_exit_fail_msg("futex_cmp_requeue_pi found no waiters\n");
}
pthread_join(child, NULL);
if (!ret && !child_ret)
ksft_test_result_pass("futex_requeue_pi_mismatched_ops passed\n");
else
ksft_test_result_pass("futex_requeue_pi_mismatched_ops failed\n");
}
TEST_HARNESS_MAIN
Annotation
- Immediate include surface: `errno.h`, `getopt.h`, `pthread.h`, `stdio.h`, `stdlib.h`, `string.h`, `time.h`, `futextest.h`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.