diff options
Diffstat (limited to 'usr/src/uts/common/syscall/memcntl.c')
-rw-r--r-- | usr/src/uts/common/syscall/memcntl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/src/uts/common/syscall/memcntl.c b/usr/src/uts/common/syscall/memcntl.c index ae2a0cc45c..721f884a7e 100644 --- a/usr/src/uts/common/syscall/memcntl.c +++ b/usr/src/uts/common/syscall/memcntl.c @@ -115,13 +115,17 @@ memcntl(caddr_t addr, size_t len, int cmd, caddr_t arg, int attr, int mask) * MS_SYNC used to be defined to be zero but is now non-zero. * For binary compatibility we still accept zero * (the absence of MS_ASYNC) to mean the same thing. + * Binary compatibility is not an issue for MS_INVALCURPROC. */ iarg = (uintptr_t)arg; if ((iarg & ~MS_INVALIDATE) == 0) iarg |= MS_SYNC; - if (((iarg & ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE)) != 0) || - ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC))) { + if (((iarg & + ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE|MS_INVALCURPROC)) != 0) || + ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC)) || + ((iarg & (MS_INVALIDATE|MS_INVALCURPROC)) == + (MS_INVALIDATE|MS_INVALCURPROC))) { error = set_errno(EINVAL); } else { error = as_ctl(as, addr, len, cmd, attr, iarg, NULL, 0); @@ -347,7 +351,8 @@ memcntl(caddr_t addr, size_t len, int cmd, caddr_t arg, int attr, int mask) } return (error); case MC_ADVISE: - if ((uintptr_t)arg == MADV_FREE) { + if ((uintptr_t)arg == MADV_FREE || + (uintptr_t)arg == MADV_PURGE) { len &= PAGEMASK; } switch ((uintptr_t)arg) { |