tools/leds/led_hw_brightness_mon.c
Source file repositories/reference/linux-study-clean/tools/leds/led_hw_brightness_mon.c
File Facts
- System
- Linux kernel
- Corpus path
tools/leds/led_hw_brightness_mon.c- Extension
.c- Size
- 1826 bytes
- Lines
- 86
- 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
errno.hfcntl.hpoll.hstdio.hstdlib.hstring.htime.hunistd.hlinux/uleds.h
Detected Declarations
function main
Annotated Snippet
if (ret == -1) {
printf("Failed to poll %s file (%d)\n",
brightness_file_path, ret);
ret = 1;
break;
}
clock_gettime(CLOCK_MONOTONIC, &ts);
ret = read(fd, buf, sizeof(buf));
if (ret < 0)
break;
ret = lseek(pollfd.fd, 0, SEEK_SET);
if (ret < 0) {
printf("lseek failed (%d)\n", ret);
break;
}
printf("[%ld.%09ld] %d\n", ts.tv_sec, ts.tv_nsec, atoi(buf));
}
close(fd);
return ret;
}
Annotation
- Immediate include surface: `errno.h`, `fcntl.h`, `poll.h`, `stdio.h`, `stdlib.h`, `string.h`, `time.h`, `unistd.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.