Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- char line[1024], *p;
- FILE *f;
- if (!(f = fopen("/proc/cpuinfo", "r")))
- err(1, "fopen");
- n = 5;
- while (n--)
- if(!fgets(line, sizeof(line), f))
- err(1, "fgets");
- fclose(f);
- n = strlen(line);
- line[--n] = '\0';
- if ((p = strchr(line, ':')) && (p + 2 - line) < n)
- fputs(p + 2, stdout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement