-static int read_bogomips(unsigned long *u) {
- _cleanup_fclose_ FILE *f = NULL;
-
- f = fopen("/proc/cpuinfo", "re");
- if (!f)
- return -errno;
-
- while (!feof(f)) {
- char line[LINE_MAX];
- char *x;
- unsigned long a, b;
-
- if (!fgets(line, sizeof(line), f))
- return -EIO;
-
- char_array_0(line);
- truncate_nl(line);
-
- if (!startswith(line, "bogomips"))
- continue;
-
- x = line + 8;
- x += strspn(x, WHITESPACE);
- if (*x != ':')
- continue;
- x++;
- x += strspn(x, WHITESPACE);
-
- if (sscanf(x, "%lu.%lu", &a, &b) != 2)
- continue;
-
- *u = a * 1000000L + b * 10000L;
- return 0;
- }
-
- return -EIO;
-}
-
-static int read_ticks(sd_id128_t vendor, const char *name, unsigned long speed, usec_t *u) {