this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add sys_msync()

+61
+3
src/kernel/emulation/linux/CMakeLists.txt
··· 36 36 unistd/writev.c 37 37 mman/mman.c 38 38 mman/madvise.c 39 + mman/msync.c 40 + kqueue/kqueue.c 41 + kqueue/kevent.c 39 42 unistd/fsync.c 40 43 unistd/sync.c 41 44 unistd/fdatasync.c
+35
src/kernel/emulation/linux/mman/msync.c
··· 1 + #include "msync.h" 2 + #include "duct_mman.h" 3 + #include "../errno.h" 4 + #include "../base.h" 5 + #include <linux-syscalls/linux.h> 6 + 7 + int msync_flags_bsd_to_linux(int flags) 8 + { 9 + int oflags = 0; 10 + 11 + if (flags & BSD_MS_ASYNC) 12 + oflags |= LINUX_MS_ASYNC; 13 + if (flags & BSD_MS_SYNC) 14 + oflags |= LINUX_MS_SYNC; 15 + if (flags & BSD_MS_INVALIDATE) 16 + oflags |= LINUX_MS_INVALIDATE; 17 + 18 + return oflags; 19 + } 20 + 21 + long sys_msync(void* addr, unsigned long len, int flags) 22 + { 23 + return sys_msync_nocancel(addr, len, flags); 24 + } 25 + 26 + long sys_msync_nocancel(void* addr, unsigned long len, int flags) 27 + { 28 + int ret; 29 + 30 + ret = LINUX_SYSCALL(__NR_msync, addr, len, msync_flags_bsd_to_linux(flags)); 31 + if (ret < 0) 32 + ret = errno_linux_to_bsd(ret); 33 + 34 + return ret; 35 + }
+16
src/kernel/emulation/linux/mman/msync.h
··· 1 + #ifndef LINUX_MSYNC_H 2 + #define LINUX_MSYNC_H 3 + 4 + long sys_msync(void* addr, unsigned long len, int flags); 5 + long sys_msync_nocancel(void* addr, unsigned long len, int flags); 6 + 7 + #define LINUX_MS_ASYNC 1 8 + #define LINUX_MS_INVALIDATE 2 9 + #define LINUX_MS_SYNC 4 10 + 11 + #define BSD_MS_ASYNC 1 12 + #define BSD_MS_INVALIDATE 2 13 + #define BSD_MS_SYNC 0x10 14 + 15 + #endif 16 +
+7
src/kernel/emulation/linux/syscalls.c
··· 1 1 #include "syscalls.h" 2 2 3 + #include "kqueue/kqueue.h" 4 + #include "kqueue/kevent.h" 3 5 #include "unistd/write.h" 4 6 #include "unistd/read.h" 5 7 #include "mman/mman.h" 6 8 #include "mman/madvise.h" 9 + #include "mman/msync.h" 7 10 #include "unistd/sync.h" 8 11 #include "unistd/fsync.h" 9 12 #include "unistd/fdatasync.h" ··· 207 210 [59] = sys_execve, 208 211 [60] = sys_umask, 209 212 [61] = sys_chroot, 213 + [65] = sys_msync, 210 214 [66] = sys_vfork, 211 215 [73] = sys_munmap, 212 216 [74] = sys_mprotect, ··· 321 325 [347] = sys_getfsstat64, 322 326 [360] = sys_bsdthread_create, 323 327 [361] = sys_bsdthread_terminate, 328 + [362] = sys_kqueue, 329 + [363] = sys_kevent, 324 330 [364] = sys_lchown, 325 331 [366] = sys_bsdthread_register, 326 332 [367] = sys_workq_open, ··· 335 341 [402] = sys_sendmsg_nocancel, 336 342 [403] = sys_recvfrom_nocancel, 337 343 [404] = sys_accept_nocancel, 344 + [405] = sys_msync_nocancel, 338 345 [406] = sys_fcntl_nocancel, 339 346 [407] = sys_select_nocancel, 340 347 [408] = sys_fsync_nocancel,