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