1 // SPDX-License-Identifier: GPL-2.0 1 // SPDX-License-Identifier: GPL-2.0 2 #include <stdio.h> 2 #include <stdio.h> 3 #include <string.h> 3 #include <string.h> 4 4 5 #define VDSO__MAP_NAME "[vdso]" 5 #define VDSO__MAP_NAME "[vdso]" 6 6 7 /* 7 /* 8 * Include definition of find_map() also used !! 8 * Include definition of find_vdso_map() also used in util/vdso.c for 9 * building perf. 9 * building perf. 10 */ 10 */ 11 #include "util/find-map.c" !! 11 #include "util/find-vdso-map.c" 12 12 13 int main(void) 13 int main(void) 14 { 14 { 15 void *start, *end; 15 void *start, *end; 16 size_t size, written; 16 size_t size, written; 17 17 18 if (find_map(&start, &end, VDSO__MAP_N !! 18 if (find_vdso_map(&start, &end)) 19 return 1; 19 return 1; 20 20 21 size = end - start; 21 size = end - start; 22 22 23 while (size) { 23 while (size) { 24 written = fwrite(start, 1, siz 24 written = fwrite(start, 1, size, stdout); 25 if (!written) 25 if (!written) 26 return 1; 26 return 1; 27 start += written; 27 start += written; 28 size -= written; 28 size -= written; 29 } 29 } 30 30 31 if (fflush(stdout)) 31 if (fflush(stdout)) 32 return 1; 32 return 1; 33 33 34 return 0; 34 return 0; 35 } 35 } 36 36
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.