summaryrefslogtreecommitdiff
path: root/components/Linux
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2018-04-30 15:14:37 +0200
committerAaron Marcher <me@drkhsh.at>2018-04-30 15:42:00 +0200
commit71eb1d321d1937b9fc96891fa47211a9e65a1e5e (patch)
tree32508a2fd10e733e41c22ec8ee39bea2e8dc59d4 /components/Linux
parent72f5a0d69ad43e7329064f415b4f8df3c1c2ccec (diff)
temperature: OS split
Diffstat (limited to 'components/Linux')
-rw-r--r--components/Linux/temperature.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/Linux/temperature.c b/components/Linux/temperature.c
new file mode 100644
index 0000000..fa50826
--- /dev/null
+++ b/components/Linux/temperature.c
@@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "../../util.h"
+
+const char *
+temp(const char *file)
+{
+ int temp;
+
+ return (pscanf(file, "%d", &temp) == 1) ?
+ bprintf("%d", temp / 1000) : NULL;
+}