6 const char unsigned *__map_file(const char *pathname, size_t *size)
9 const unsigned char *map = MAP_FAILED;
10 int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
12 if (!syscall(SYS_fstat, fd, &st)) {
13 map = __mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
16 __syscall(SYS_close, fd);
17 return map == MAP_FAILED ? 0 : map;