samples/cgroup/cgroup_event_listener.c
Source file repositories/reference/linux-study-clean/samples/cgroup/cgroup_event_listener.c
File Facts
- System
- Linux kernel
- Corpus path
samples/cgroup/cgroup_event_listener.c- Extension
.c- Size
- 1858 bytes
- Lines
- 84
- Domain
- Support Tooling And Documentation
- Bucket
- samples
- 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.herr.herrno.hfcntl.hlibgen.hlimits.hstdio.hstring.hunistd.hsys/eventfd.h
Detected Declarations
function Copyright
Annotated Snippet
if (ret == -1) {
if (errno == EINTR)
continue;
err(1, "Cannot read from eventfd");
}
assert(ret == sizeof(result));
ret = access(event_control_path, W_OK);
if ((ret == -1) && (errno == ENOENT)) {
puts("The cgroup seems to have removed.");
break;
}
if (ret == -1)
err(1, "cgroup.event_control is not accessible any more");
printf("%s %s: crossed\n", argv[1], argv[2]);
}
return 0;
}
Annotation
- Immediate include surface: `assert.h`, `err.h`, `errno.h`, `fcntl.h`, `libgen.h`, `limits.h`, `stdio.h`, `string.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Support Tooling And Documentation / samples.
- 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.