tools/testing/selftests/efivarfs/open-unlink.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/efivarfs/open-unlink.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/efivarfs/open-unlink.c- Extension
.c- Size
- 2252 bytes
- Lines
- 135
- 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.hstdio.hstdint.hstdlib.hunistd.hsys/ioctl.hsys/types.hsys/stat.hfcntl.hlinux/fs.h
Detected Declarations
function set_immutablefunction get_immutablefunction main
Annotated Snippet
if (rc < 0) {
perror("ioctl(FS_IOC_SETFLAGS)");
return EXIT_FAILURE;
}
}
fd = open(path, O_RDONLY);
if (fd < 0) {
perror("open");
return EXIT_FAILURE;
}
if (unlink(path) < 0) {
perror("unlink");
return EXIT_FAILURE;
}
rc = read(fd, buf, sizeof(buf));
if (rc > 0) {
fprintf(stderr, "reading from an unlinked variable "
"shouldn't be possible\n");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Annotation
- Immediate include surface: `errno.h`, `stdio.h`, `stdint.h`, `stdlib.h`, `unistd.h`, `sys/ioctl.h`, `sys/types.h`, `sys/stat.h`.
- Detected declarations: `function set_immutable`, `function get_immutable`, `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.