Index: head/lib/libc/sys/mmap.2 =================================================================== --- head/lib/libc/sys/mmap.2 +++ head/lib/libc/sys/mmap.2 @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd June 20, 2019 +.Dd February 26, 2020 .Dt MMAP 2 .Os .Sh NAME @@ -432,11 +432,6 @@ .Fa prot argument. .It Bq Er EINVAL -The -.Fa prot -argument contains permissions which are not a subset of the specified -maximum permissions. -.It Bq Er EINVAL An undefined option was set in the .Fa flags argument. @@ -530,6 +525,11 @@ argument was not available. .Dv MAP_ANON was specified and insufficient memory was available. +.It Bq Er ENOTSUP +The +.Fa prot +argument contains permissions which are not a subset of the specified +maximum permissions. .El .Sh SEE ALSO .Xr madvise 2 , Index: head/lib/libc/sys/mprotect.2 =================================================================== --- head/lib/libc/sys/mprotect.2 +++ head/lib/libc/sys/mprotect.2 @@ -28,7 +28,7 @@ .\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 20, 2019 +.Dd February 26, 2020 .Dt MPROTECT 2 .Os .Sh NAME @@ -104,7 +104,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: head/sys/vm/vm_mmap.c =================================================================== --- head/sys/vm/vm_mmap.c +++ head/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); }