summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-06 16:16:56 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-20 12:57:33 -0600
commit287843f14c2ed7bd3c02f837ac1d70d6a2659e22 (patch)
treea8df35c4b879d7000c77250f7925a5bf0f5ed033 /cpukit/posix/src
parentlibdl/.../mips/machine/elf_machdep.h: Fix typo so compiles (diff)
downloadrtems-287843f14c2ed7bd3c02f837ac1d70d6a2659e22.tar.bz2
sys/mman.h: New file. Clean up and add supporting stubs
* Makefile.am updated and preinstall.am regenerated. * mprotect.c had a prototype removed now that we have mman.h * mmap.c, munmap.c: New stub files.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/mmap.c26
-rw-r--r--cpukit/posix/src/mprotect.c10
-rw-r--r--cpukit/posix/src/munmap.c30
3 files changed, 58 insertions, 8 deletions
diff --git a/cpukit/posix/src/mmap.c b/cpukit/posix/src/mmap.c
new file mode 100644
index 0000000000..2798326524
--- /dev/null
+++ b/cpukit/posix/src/mmap.c
@@ -0,0 +1,26 @@
+/**
+ * @file
+ */
+
+/*
+ * COPYRIGHT (c) 2014.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/mman.h>
+
+int munmap(
+ void *addr __attribute__((unused)),
+ size_t length __attribute__((unused))
+)
+{
+ return -1;
+}
diff --git a/cpukit/posix/src/mprotect.c b/cpukit/posix/src/mprotect.c
index 51b565ea54..94bd316ffb 100644
--- a/cpukit/posix/src/mprotect.c
+++ b/cpukit/posix/src/mprotect.c
@@ -28,16 +28,10 @@
#endif
#include <unistd.h>
-
-/*
- * RTEMS does not have <sys/mman.h> so we need a prototype here to
- * avoid warnings.
- */
-
-int mprotect( const void *, size_t, int );
+#include <sys/mman.h>
int mprotect(
- const void *addr __attribute__((unused)),
+ void *addr __attribute__((unused)),
size_t len __attribute__((unused)),
int prot __attribute__((unused)) )
{
diff --git a/cpukit/posix/src/munmap.c b/cpukit/posix/src/munmap.c
new file mode 100644
index 0000000000..3ebb2f4f85
--- /dev/null
+++ b/cpukit/posix/src/munmap.c
@@ -0,0 +1,30 @@
+/**
+ * @file
+ */
+
+/*
+ * COPYRIGHT (c) 2014.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/mman.h>
+
+void *mmap(
+ void *addr __attribute__((unused)),
+ size_t lenhth __attribute__((unused)),
+ int prot __attribute__((unused)),
+ int flags __attribute__((unused)),
+ int fildes __attribute__((unused)),
+ off_t off
+)
+{
+ return NULL;
+}