Skip to content

Commit

Permalink
add msync() "emulation"
Browse files Browse the repository at this point in the history
  • Loading branch information
anttikantee committed Jun 22, 2015
1 parent e2731a0 commit 6c386dc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/librumprun_base/syscall_mman.c
Expand Up @@ -82,6 +82,22 @@ mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off)
#undef mmap
__weak_alias(mmap,_mmap);

int _sys__msync13(void *, size_t, int);
int
_sys__msync13(void *addr, size_t len, int flags)
{
long pagesize = sysconf(_SC_PAGESIZE);

/* catch a few easy errors */
if (((uintptr_t)addr & (pagesize-1)) != 0)
return EINVAL;
if ((flags & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC))
return EINVAL;

/* otherwise just pretend that we are the champions my friend */
return 0;
}

int
munmap(void *addr, size_t len)
{
Expand Down

0 comments on commit 6c386dc

Please sign in to comment.