7 #define MLOCK_ONFAULT 1
11 #define MCL_ONFAULT (MCL_FUTURE << 1)
14 static int mlock2_(void *start, size_t len, int flags)
17 return syscall(__NR_mlock2, start, len, flags);
24 static FILE *seek_to_smaps_entry(unsigned long addr)
29 unsigned long start, end;
36 file = fopen("/proc/self/smaps", "r");
38 perror("fopen smaps");
42 while (getline(&line, &size, file) > 0) {
43 if (sscanf(line, "%lx-%lx %s %lx %s %lu %s\n",
44 &start, &end, perms, &offset, dev, &inode, path) < 6)
47 if (start <= addr && addr < end)