svn commit: r303699 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys
Ed Schouten
ed at FreeBSD.org
Wed Aug 3 06:33:07 UTC 2016
Author: ed
Date: Wed Aug 3 06:33:04 2016
New Revision: 303699
URL: https://svnweb.freebsd.org/changeset/base/303699
Log:
mprotect(): Change prototype to comply to POSIX.
Our mprotect() function seems to take a "const void *" address to the
pages whose permissions need to be adjusted. POSIX uses "void *". Simply
stick to the POSIX one to prevent us from writing unportable code.
PR: 211423 (exp-run)
Tested by: antoine@ (Thanks!)
Modified:
head/lib/libc/sys/mprotect.2
head/sys/compat/freebsd32/syscalls.master
head/sys/kern/syscalls.master
head/sys/sys/mman.h
Modified: head/lib/libc/sys/mprotect.2
==============================================================================
--- head/lib/libc/sys/mprotect.2 Wed Aug 3 06:32:44 2016 (r303698)
+++ head/lib/libc/sys/mprotect.2 Wed Aug 3 06:33:04 2016 (r303699)
@@ -28,7 +28,7 @@
.\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd June 9, 1993
+.Dd August 3, 2016
.Dt MPROTECT 2
.Os
.Sh NAME
@@ -39,7 +39,7 @@
.Sh SYNOPSIS
.In sys/mman.h
.Ft int
-.Fn mprotect "const void *addr" "size_t len" "int prot"
+.Fn mprotect "void *addr" "size_t len" "int prot"
.Sh DESCRIPTION
The
.Fn mprotect
Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master Wed Aug 3 06:32:44 2016 (r303698)
+++ head/sys/compat/freebsd32/syscalls.master Wed Aug 3 06:33:04 2016 (r303699)
@@ -174,7 +174,7 @@
72 AUE_O_VADVISE NOPROTO { int ovadvise(int anom); } vadvise \
ovadvise_args int
73 AUE_MUNMAP NOPROTO { int munmap(void *addr, size_t len); }
-74 AUE_MPROTECT STD { int freebsd32_mprotect(const void *addr, \
+74 AUE_MPROTECT STD { int freebsd32_mprotect(void *addr, \
size_t len, int prot); }
75 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \
int behav); }
Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master Wed Aug 3 06:32:44 2016 (r303698)
+++ head/sys/kern/syscalls.master Wed Aug 3 06:33:04 2016 (r303699)
@@ -175,7 +175,7 @@
72 AUE_O_VADVISE STD { int ovadvise(int anom); } vadvise \
ovadvise_args int
73 AUE_MUNMAP STD { int munmap(void *addr, size_t len); }
-74 AUE_MPROTECT STD { int mprotect(const void *addr, size_t len, \
+74 AUE_MPROTECT STD { int mprotect(void *addr, size_t len,
int prot); }
75 AUE_MADVISE STD { int madvise(void *addr, size_t len, \
int behav); }
Modified: head/sys/sys/mman.h
==============================================================================
--- head/sys/sys/mman.h Wed Aug 3 06:32:44 2016 (r303698)
+++ head/sys/sys/mman.h Wed Aug 3 06:33:04 2016 (r303699)
@@ -258,7 +258,7 @@ int mlock(const void *, size_t);
#define _MMAP_DECLARED
void * mmap(void *, size_t, int, int, int, off_t);
#endif
-int mprotect(const void *, size_t, int);
+int mprotect(void *, size_t, int);
int msync(void *, size_t, int);
int munlock(const void *, size_t);
int munmap(void *, size_t);
More information about the svn-src-head
mailing list