Index: lib/libc/sys/mmap.2 =================================================================== --- lib/libc/sys/mmap.2 +++ lib/libc/sys/mmap.2 @@ -431,7 +431,7 @@ An invalid value was passed in the .Fa prot argument. -.It Bq Er EINVAL +.It Bq Er ENOTSUP The .Fa prot argument contains permissions which are not a subset of the specified Index: lib/libc/sys/mprotect.2 =================================================================== --- lib/libc/sys/mprotect.2 +++ lib/libc/sys/mprotect.2 @@ -98,7 +98,7 @@ The .Fa prot argument contains unhandled bits. -.It Bq Er EINVAL +.It Bq Er ENOTSUP The .Fa prot argument contains permissions which are not a subset of the specified Index: sys/vm/vm_mmap.c =================================================================== --- sys/vm/vm_mmap.c +++ sys/vm/vm_mmap.c @@ -225,7 +225,7 @@ max_prot = PROT_MAX_EXTRACT(prot); prot = PROT_EXTRACT(prot); if (max_prot != 0 && (max_prot & prot) != prot) - return (EINVAL); + return (ENOTSUP); p = td->td_proc; @@ -668,7 +668,7 @@ vm_error = KERN_SUCCESS; if (max_prot != 0) { if ((max_prot & prot) != prot) - return (EINVAL); + return (ENOTSUP); vm_error = vm_map_protect(&td->td_proc->p_vmspace->vm_map, addr, addr + size, max_prot, TRUE); }