mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 13:51:28 +00:00
22 lines
372 B
C
22 lines
372 B
C
#define _GNU_SOURCE
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <errno.h>
|
|
|
|
int main (int argc, char ** argv)
|
|
{
|
|
FILE * cpuinfo = fopen("/proc/meminfo", "rb");
|
|
char * arg = 0;
|
|
size_t size = 0;
|
|
|
|
if (!cpuinfo)
|
|
return errno;
|
|
|
|
while(getdelim(&arg, &size, 0, cpuinfo) != -1)
|
|
puts(arg);
|
|
|
|
free(arg);
|
|
fclose(cpuinfo);
|
|
return 0;
|
|
}
|