tools/testing/selftests/net/lib/ksft.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/lib/ksft.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/lib/ksft.h- Extension
.h- Size
- 1006 bytes
- Lines
- 59
- 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
stdio.hstdlib.hunistd.h
Detected Declarations
function ksft_readyfunction ksft_wait
Annotated Snippet
if (!fd) {
fprintf(stderr, "invalid KSFT_READY_FD = '%s'\n",
env_str);
return;
}
} else {
fd = STDOUT_FILENO;
}
if (write(fd, msg, sizeof(msg)) < 0)
perror("write()");
if (fd != STDOUT_FILENO)
close(fd);
}
static inline void ksft_wait(void)
{
char *env_str;
char byte;
int fd;
env_str = getenv("KSFT_WAIT_FD");
if (env_str) {
fd = atoi(env_str);
if (!fd) {
fprintf(stderr, "invalid KSFT_WAIT_FD = '%s'\n",
env_str);
return;
}
} else {
/* Not running in KSFT env, wait for input from STDIN instead */
fd = STDIN_FILENO;
}
if (read(fd, &byte, sizeof(byte)) < 0)
perror("read()");
if (fd != STDIN_FILENO)
close(fd);
}
#endif
Annotation
- Immediate include surface: `stdio.h`, `stdlib.h`, `unistd.h`.
- Detected declarations: `function ksft_ready`, `function ksft_wait`.
- 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.