9 * Reads the CPU temperature from /sys/class/thermal/thermal_zone0/temp and
10 * returns the temperature in degree celcius.
13 const char *get_cpu_temperature_info() {
17 slurp(thermal_zone, buf, sizeof(buf));
18 temp = strtol(buf, NULL, 10);
20 if (temp == LONG_MIN || temp == LONG_MAX || temp <= 0)
21 (void)snprintf(buf, sizeof(buf), "T: ? C");
23 (void)snprintf(buf, sizeof(buf), "T: %ld C", (temp/1000));