posix: Add configure check for mprotect()

Update #3491.
This commit is contained in:
Sebastian Huber
2018-08-10 07:14:43 +02:00
parent 8e6cfccf8c
commit aac36d153a
2 changed files with 14 additions and 0 deletions
+10
View File
@@ -116,6 +116,16 @@ RTEMS_CHECK_FUNC([pthread_getattr_np],[
#include <pthread.h>])
AC_LANG_PUSH(C)
AC_MSG_CHECKING([for mprotect(const void *, ...)])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <sys/mman.h>
int mprotect(const void *, size_t, int);
])],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_MPROTECT_CONST, [], [mprotect(const void *, ...)])
],[
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([for pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <pthread.h>
+4
View File
@@ -31,7 +31,11 @@
#include <sys/mman.h>
int mprotect(
#ifdef HAVE_MPROTECT_CONST
const void *addr,
#else
void *addr,
#endif
size_t len,
int prot
)