tools/testing/selftests/timers/skew_consistency.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/timers/skew_consistency.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/timers/skew_consistency.c- Extension
.c- Size
- 1793 bytes
- Lines
- 76
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstdlib.hunistd.hsys/time.hsys/timex.htime.hsys/types.hsys/stat.hfcntl.hstring.hsys/wait.hkselftest.h
Detected Declarations
function main
Annotated Snippet
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/timex.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <sys/wait.h>
#include "kselftest.h"
int main(int argc, char **argv)
{
struct timex tx;
int ret, ppm;
pid_t pid;
printf("Running Asynchronous Frequency Changing Tests...\n");
pid = fork();
if (!pid)
return system("./inconsistency-check -t 60");
ppm = 500;
ret = 0;
while (pid != waitpid(pid, &ret, WNOHANG)) {
ppm = -ppm;
tx.modes = ADJ_FREQUENCY;
tx.freq = ppm << 16;
adjtimex(&tx);
usleep(500000);
}
/* Set things back */
tx.modes = ADJ_FREQUENCY;
tx.offset = 0;
adjtimex(&tx);
if (ret) {
printf("[FAILED]\n");
ksft_exit_fail();
}
printf("[OK]\n");
ksft_exit_pass();
}
Annotation
- Immediate include surface: `stdio.h`, `stdlib.h`, `unistd.h`, `sys/time.h`, `sys/timex.h`, `time.h`, `sys/types.h`, `sys/stat.h`.
- Detected declarations: `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.