diff options
Diffstat (limited to 'pk')
-rw-r--r-- | pk/syscall.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pk/syscall.c b/pk/syscall.c index c5f650c..e6b2454 100644 --- a/pk/syscall.c +++ b/pk/syscall.c @@ -320,8 +320,12 @@ int sys_getuid() uintptr_t sys_mmap(uintptr_t addr, size_t length, int prot, int flags, int fd, off_t offset) { - uintptr_t ret = do_mmap(addr, length, prot, flags, fd, offset); - return ret; +#ifdef __riscv32 + if (offset != (offset << 12 >> 12)) + return -ENXIO; + offset <<= 12; +#endif + return do_mmap(addr, length, prot, flags, fd, offset); } int sys_munmap(uintptr_t addr, size_t length) |