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.

Dependency Surface

Detected Declarations

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

Implementation Notes