X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2F__map_file.c;h=d3cefa8284cc80f2b2205065372b1a3e30fef43b;hb=3437e478ba932edbab18a90638c20be1f0141156;hp=b91eb8edb986438c75152d737e6f4734b8e04fb1;hpb=bd275378d35b3535bc8b8321780b00e486c36d96;p=musl diff --git a/src/time/__map_file.c b/src/time/__map_file.c index b91eb8ed..d3cefa82 100644 --- a/src/time/__map_file.c +++ b/src/time/__map_file.c @@ -2,16 +2,15 @@ #include #include #include "syscall.h" - -void *__mmap(void *, size_t, int, int, int, off_t); +#include "kstat.h" const char unsigned *__map_file(const char *pathname, size_t *size) { - struct stat st; + struct kstat st; const unsigned char *map = MAP_FAILED; - int fd = __sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK); + int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK); if (fd < 0) return 0; - if (!__syscall(SYS_fstat, fd, &st)) { + if (!syscall(SYS_fstat, fd, &st)) { map = __mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); *size = st.st_size; }