forked from Imagelibrary/rtems
posix: add stub implementations for mman functions
This commit is contained in:
@@ -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
27
cpukit/posix/src/mlock.c
Normal 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 );
|
||||
}
|
||||
26
cpukit/posix/src/mlockall.c
Normal file
26
cpukit/posix/src/mlockall.c
Normal 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
28
cpukit/posix/src/msync.c
Normal 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 );
|
||||
}
|
||||
27
cpukit/posix/src/munlock.c
Normal file
27
cpukit/posix/src/munlock.c
Normal 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 );
|
||||
}
|
||||
24
cpukit/posix/src/munlockall.c
Normal file
24
cpukit/posix/src/munlockall.c
Normal 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 );
|
||||
}
|
||||
28
cpukit/posix/src/posix_madvise.c
Normal file
28
cpukit/posix/src/posix_madvise.c
Normal 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;
|
||||
}
|
||||
28
cpukit/posix/src/shmopen.c
Normal file
28
cpukit/posix/src/shmopen.c
Normal 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 );
|
||||
}
|
||||
26
cpukit/posix/src/shmunlink.c
Normal file
26
cpukit/posix/src/shmunlink.c
Normal 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 );
|
||||
}
|
||||
Reference in New Issue
Block a user