October 2017
Intermediate to advanced
586 pages
14h 8m
English
The kernel code responsible for instantiating RTC attributes in sysfs is defined in drivers/rtc/rtc-sysfs.c, in the kernel source tree. Once registered, an RTC device will create a rtc<id> directory under /sys/class/rtc. That directory contains a set of read-only attributes, the most important of which are:
$ cat /sys/class/rtc/rtc0/date 2017-08-28
$ cat /sys/class/rtc/rtc0/time
14:54:20
$ ...