From 1ca8ee137e9e7dc815e55cc06ebd2c2c4e2191be Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 12 Aug 2016 11:17:40 -0400 Subject: posix: add stub implementations for mman functions --- cpukit/posix/Makefile.am | 8 ++++++++ cpukit/posix/src/mlock.c | 27 +++++++++++++++++++++++++++ cpukit/posix/src/mlockall.c | 26 ++++++++++++++++++++++++++ cpukit/posix/src/msync.c | 28 ++++++++++++++++++++++++++++ cpukit/posix/src/munlock.c | 27 +++++++++++++++++++++++++++ cpukit/posix/src/munlockall.c | 24 ++++++++++++++++++++++++ cpukit/posix/src/posix_madvise.c | 28 ++++++++++++++++++++++++++++ cpukit/posix/src/shmopen.c | 28 ++++++++++++++++++++++++++++ cpukit/posix/src/shmunlink.c | 26 ++++++++++++++++++++++++++ 9 files changed, 222 insertions(+) create mode 100644 cpukit/posix/src/mlock.c create mode 100644 cpukit/posix/src/mlockall.c create mode 100644 cpukit/posix/src/msync.c create mode 100644 cpukit/posix/src/munlock.c create mode 100644 cpukit/posix/src/munlockall.c create mode 100644 cpukit/posix/src/posix_madvise.c create mode 100644 cpukit/posix/src/shmopen.c create mode 100644 cpukit/posix/src/shmunlink.c 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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +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 +#include +#include + +int shm_unlink( const char *name ) +{ + (void) name; + + rtems_set_errno_and_return_minus_one( ENOENT ); +} -- cgit v1.2.3