posix: add stub implementations for mman functions

This commit is contained in:
Gedare Bloom
2016-08-12 11:17:40 -04:00
parent e7eeb38d23
commit 1ca8ee137e
9 changed files with 222 additions and 0 deletions

View File

@@ -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 \

27
cpukit/posix/src/mlock.c Normal file
View File

@@ -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 );
}

View File

@@ -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 );
}

28
cpukit/posix/src/msync.c Normal file
View File

@@ -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 );
}

View File

@@ -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 );
}

View File

@@ -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 );
}

View File

@@ -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;
}

View File

@@ -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 );
}

View File

@@ -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 );
}