summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2016-08-12 11:17:40 -0400
committerGedare Bloom <gedare@rtems.org>2017-01-13 11:05:56 -0500
commit1ca8ee137e9e7dc815e55cc06ebd2c2c4e2191be (patch)
treea1556767a5daaacb0f88616e5c5344f49745acab
parentposix: move sys/mman.h to newlib and test it in psxhdrs (diff)
downloadrtems-1ca8ee137e9e7dc815e55cc06ebd2c2c4e2191be.tar.bz2
posix: add stub implementations for mman functions
-rw-r--r--cpukit/posix/Makefile.am8
-rw-r--r--cpukit/posix/src/mlock.c27
-rw-r--r--cpukit/posix/src/mlockall.c26
-rw-r--r--cpukit/posix/src/msync.c28
-rw-r--r--cpukit/posix/src/munlock.c27
-rw-r--r--cpukit/posix/src/munlockall.c24
-rw-r--r--cpukit/posix/src/posix_madvise.c28
-rw-r--r--cpukit/posix/src/shmopen.c28
-rw-r--r--cpukit/posix/src/shmunlink.c26
9 files changed, 222 insertions, 0 deletions
diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am
index 8323de8f8b..53faacee70 100644
--- a/cpukit/posix/Makefile.am
+++ b/cpukit/posix/Makefile.am
@@ -89,9 +89,17 @@ libposix_a_SOURCES += src/cond.c src/condattrdestroy.c \
src/condtimedwait.c src/condwait.c src/condwaitsupp.c src/condget.c
## MEMORY_C_FILES
+libposix_a_SOURCES += src/mlockall.c
+libposix_a_SOURCES += src/mlock.c
libposix_a_SOURCES += src/mmap.c
libposix_a_SOURCES += src/mprotect.c
+libposix_a_SOURCES += src/msync.c
+libposix_a_SOURCES += src/munlockall.c
+libposix_a_SOURCES += src/munlock.c
libposix_a_SOURCES += src/munmap.c
+libposix_a_SOURCES += src/posix_madvise.c
+libposix_a_SOURCES += src/shmopen.c
+libposix_a_SOURCES += src/shmunlink.c
## MESSAGE_QUEUE_C_FILES
libposix_a_SOURCES += src/mqueue.c src/mqueueclose.c \
diff --git a/cpukit/posix/src/mlock.c b/cpukit/posix/src/mlock.c
new file mode 100644
index 0000000000..4f7d3c0786
--- /dev/null
+++ b/cpukit/posix/src/mlock.c
@@ -0,0 +1,27 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int mlock( const void *addr, size_t len )
+{
+ (void) addr;
+ (void) len;
+
+ rtems_set_errno_and_return_minus_one( ENOMEM );
+}
diff --git a/cpukit/posix/src/mlockall.c b/cpukit/posix/src/mlockall.c
new file mode 100644
index 0000000000..1fd4ed5fa2
--- /dev/null
+++ b/cpukit/posix/src/mlockall.c
@@ -0,0 +1,26 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int mlockall( int flags )
+{
+ (void) flags;
+
+ rtems_set_errno_and_return_minus_one( EINVAL );
+}
diff --git a/cpukit/posix/src/msync.c b/cpukit/posix/src/msync.c
new file mode 100644
index 0000000000..fa84083c90
--- /dev/null
+++ b/cpukit/posix/src/msync.c
@@ -0,0 +1,28 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int msync( void *addr, size_t len, int flags )
+{
+ (void) addr;
+ (void) len;
+ (void) flags;
+
+ rtems_set_errno_and_return_minus_one( EINVAL );
+}
diff --git a/cpukit/posix/src/munlock.c b/cpukit/posix/src/munlock.c
new file mode 100644
index 0000000000..7a4b104de0
--- /dev/null
+++ b/cpukit/posix/src/munlock.c
@@ -0,0 +1,27 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int munlock( const void *addr, size_t len )
+{
+ (void) addr;
+ (void) len;
+
+ rtems_set_errno_and_return_minus_one( ENOMEM );
+}
diff --git a/cpukit/posix/src/munlockall.c b/cpukit/posix/src/munlockall.c
new file mode 100644
index 0000000000..c24cfc9cd3
--- /dev/null
+++ b/cpukit/posix/src/munlockall.c
@@ -0,0 +1,24 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int munlockall( void )
+{
+ rtems_set_errno_and_return_minus_one( EINVAL );
+}
diff --git a/cpukit/posix/src/posix_madvise.c b/cpukit/posix/src/posix_madvise.c
new file mode 100644
index 0000000000..b909a1c84b
--- /dev/null
+++ b/cpukit/posix/src/posix_madvise.c
@@ -0,0 +1,28 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int posix_madvise( void *addr, size_t len, int advice )
+{
+ (void) addr;
+ (void) len;
+ (void) advice;
+
+ return EINVAL;
+}
diff --git a/cpukit/posix/src/shmopen.c b/cpukit/posix/src/shmopen.c
new file mode 100644
index 0000000000..abac3f4057
--- /dev/null
+++ b/cpukit/posix/src/shmopen.c
@@ -0,0 +1,28 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int shm_open( const char *name, int oflag, mode_t mode )
+{
+ (void) name;
+ (void) oflag;
+ (void) mode;
+
+ rtems_set_errno_and_return_minus_one( EINVAL );
+}
diff --git a/cpukit/posix/src/shmunlink.c b/cpukit/posix/src/shmunlink.c
new file mode 100644
index 0000000000..f5599227b1
--- /dev/null
+++ b/cpukit/posix/src/shmunlink.c
@@ -0,0 +1,26 @@
+/**
+ * @file
+ */
+
+/*
+ * Copyright (c) 2016 Gedare Bloom.
+ *
+ * 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>
+#include <errno.h>
+#include <rtems/seterr.h>
+
+int shm_unlink( const char *name )
+{
+ (void) name;
+
+ rtems_set_errno_and_return_minus_one( ENOENT );
+}