build system updates, port libc-testsuit changes
[libc-test] / common / b.c
index 6df833a..6fa1963 100644 (file)
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -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;