tools/testing/selftests/rseq/basic_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/rseq/basic_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/rseq/basic_test.c- Extension
.c- Size
- 1417 bytes
- Lines
- 61
- 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
assert.hsched.hsignal.hstdio.hstring.hsys/time.hrseq.h
Detected Declarations
function rseq_current_cpufunction main
Annotated Snippet
if (CPU_ISSET(i, &affinity)) {
int node;
CPU_SET(i, &test_affinity);
sched_setaffinity(0, sizeof(test_affinity),
&test_affinity);
assert(sched_getcpu() == i);
assert(rseq_current_cpu() == i);
assert(rseq_current_cpu_raw() == i);
assert(rseq_cpu_start() == i);
node = rseq_fallback_current_node();
assert(rseq_current_node_id() == node);
CPU_CLR(i, &test_affinity);
}
}
sched_setaffinity(0, sizeof(affinity), &affinity);
}
int main(int argc, char **argv)
{
if (rseq_register_current_thread()) {
fprintf(stderr, "Error: rseq_register_current_thread(...) failed(%d): %s\n",
errno, strerror(errno));
goto init_thread_error;
}
printf("testing current cpu\n");
test_cpu_pointer();
if (rseq_unregister_current_thread()) {
fprintf(stderr, "Error: rseq_unregister_current_thread(...) failed(%d): %s\n",
errno, strerror(errno));
goto init_thread_error;
}
return 0;
init_thread_error:
return -1;
}
Annotation
- Immediate include surface: `assert.h`, `sched.h`, `signal.h`, `stdio.h`, `string.h`, `sys/time.h`, `rseq.h`.
- Detected declarations: `function rseq_current_cpu`, `function main`.
- 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.