tools/testing/selftests/media_tests/video_device_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/media_tests/video_device_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/media_tests/video_device_test.c- Extension
.c- Size
- 3797 bytes
- Lines
- 157
- 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.hunistd.hstdlib.herrno.hstring.hfcntl.hsys/ioctl.hsys/stat.htime.hlinux/videodev2.h
Detected Declarations
function Copyrightfunction loop_testfunction main
Annotated Snippet
switch (opt) {
case 'd':
strncpy(video_dev, optarg, sizeof(video_dev) - 1);
video_dev[sizeof(video_dev)-1] = '\0';
break;
default:
printf("Usage: %s [-d </dev/videoX>]\n", argv[0]);
exit(-1);
}
}
/* Open Video device and keep it open */
fd = open(video_dev, O_RDWR);
if (fd == -1) {
printf("Video Device open errno %s\n", strerror(errno));
exit(-1);
}
test_result = priority_test(fd);
if (!test_result)
printf("Priority test - PASSED\n");
else
printf("Priority test - FAILED\n");
loop_test(fd);
}
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `stdlib.h`, `errno.h`, `string.h`, `fcntl.h`, `sys/ioctl.h`, `sys/stat.h`.
- Detected declarations: `function Copyright`, `function loop_test`, `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.