Fetch freq from cpuid, instead of asking Linux (using /proc). This finally removes udev dependency. However, the support of cpuid 0x16 is limited, so this may break cpufetch on some systems

This commit is contained in:
Dr-Noob
2020-06-20 13:24:50 +02:00
parent 04a2fef2a2
commit b81d611282
9 changed files with 111 additions and 156 deletions

View File

@@ -5,7 +5,17 @@
#define RED "\x1b[31;1m"
#define RESET "\x1b[0m"
void printError(const char *fmt, ...) {
void printErr(const char *fmt, ...) {
int buffer_size = 4096;
char buffer[buffer_size];
va_list args;
va_start(args, fmt);
vsnprintf(buffer,buffer_size, fmt, args);
va_end(args);
fprintf(stderr,RED "ERROR: "RESET "%s\n",buffer);
}
void printBug(const char *fmt, ...) {
int buffer_size = 4096;
char buffer[buffer_size];
va_list args;