This commit is contained in:
2026-06-24 21:07:30 +02:00
parent f7ed895f3b
commit 43d7f0ed4a

View File

@@ -84,6 +84,7 @@ int get_hwmon_dir(char *path, const size_t bufsz) {
* actual slowdown is in the syscalls anyway, open(), read(), close () */
/* read n bytes from path into buffer */
// file descriptors shouldnt change once opened, so we could open once, cache them, just call read() in the loop, then close all of them on program exit?
inline size_t read_file(const char *dir, const char *file, char *buffer, const size_t n) {
char path[160]; // bug alert
char *nt = stpcpy(path, dir); // nt is a pointer to the null terminator of the copied string