mlx4_en: Use correct loop cursor in error path.
[linux/fpc-iii.git] / tools / perf / perf-read-vdso.c
blob764e2547c25abf0c6e0fa7979b3e1c32bfdc99b9
1 #include <stdio.h>
2 #include <string.h>
4 #define VDSO__MAP_NAME "[vdso]"
6 /*
7 * Include definition of find_vdso_map() also used in util/vdso.c for
8 * building perf.
9 */
10 #include "util/find-vdso-map.c"
12 int main(void)
14 void *start, *end;
15 size_t size, written;
17 if (find_vdso_map(&start, &end))
18 return 1;
20 size = end - start;
22 while (size) {
23 written = fwrite(start, 1, size, stdout);
24 if (!written)
25 return 1;
26 start += written;
27 size -= written;
30 if (fflush(stdout))
31 return 1;
33 return 0;