X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=common%2Fb.c;h=6fa1963e0f80eea350961080edea76e17ffb7021;hb=8f27a344abbb2caa2306e784c0f1a411dd301081;hp=6df833afde96e5900904fedabba9690ce4280dcc;hpb=7d87d3f6a765bea943beb384f9bbf359e3768c0a;p=libc-test diff --git a/common/b.c b/common/b.c index 6df833a..6fa1963 100644 --- a/common/b.c +++ b/common/b.c @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 200809L #include #include #include @@ -31,7 +30,7 @@ static unsigned long long dt; static unsigned long long tic() { struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { + if (clock_gettime(CLOCK_REALTIME, &ts) < 0) { fprintf(stderr, "bench: clock_gettime failed: %s\n", strerror(errno)); return 0; } @@ -89,7 +88,7 @@ void vmstats() { f = fopen("/proc/self/smaps", "rb"); if (f) while (fgets(buf, sizeof buf, f)) { - if (sscanf(buf, "%*lx-%*lx %*s %*lx %x:%x %*lu %*s", &maj, &min)==2) + if (sscanf(buf, "%*x-%*x %*s %*x %x:%x %*u %*s", &maj, &min)==2) in_heap = (!maj && !min && !strstr(buf, "---p") && (strstr(buf, "[heap]") || !strchr(buf, '['))); if (in_heap) { if (sscanf(buf, "Size: %lu", &l)==1) vm_size += l;