diff options
author | Gedare Bloom <gedare@rtems.org> | 2016-07-29 15:28:49 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2017-01-13 11:05:56 -0500 |
commit | e7eeb38d23b990c5d64ad395cddad0b091f29f90 (patch) | |
tree | 4bddc87065aa7f5e5b89e4d249ded5f0f92dc61d /testsuites/psxtests/psxhdrs | |
parent | configure: Remove __RTEMS_DO_NOT_INLINE_THREAD_* (diff) | |
download | rtems-e7eeb38d23b990c5d64ad395cddad0b091f29f90.tar.bz2 |
posix: move sys/mman.h to newlib and test it in psxhdrs
Diffstat (limited to 'testsuites/psxtests/psxhdrs')
-rw-r--r-- | testsuites/psxtests/psxhdrs/Makefile.am | 13 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/mlock.c | 28 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/mlockall.c | 27 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/mmap.c | 30 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/mprotect.c | 29 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/msync.c | 29 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/munlock.c | 28 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/munlockall.c | 25 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/munmap.c | 28 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/posix_madvise.c | 29 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/shm_open.c | 29 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/sys/mman/shm_unlink.c | 27 |
12 files changed, 322 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/Makefile.am b/testsuites/psxtests/psxhdrs/Makefile.am index e902500b9d..a987bf0639 100644 --- a/testsuites/psxtests/psxhdrs/Makefile.am +++ b/testsuites/psxtests/psxhdrs/Makefile.am @@ -141,6 +141,19 @@ lib_a_SOURCES += unistd/sync.c lib_a_SOURCES += unistd/ualarm.c lib_a_SOURCES += unistd/usleep.c +# methods in <sys/mman.h> +lib_a_SOURCES += sys/mman/mlockall.c +lib_a_SOURCES += sys/mman/mlock.c +lib_a_SOURCES += sys/mman/mmap.c +lib_a_SOURCES += sys/mman/mprotect.c +lib_a_SOURCES += sys/mman/msync.c +lib_a_SOURCES += sys/mman/munlockall.c +lib_a_SOURCES += sys/mman/munlock.c +lib_a_SOURCES += sys/mman/munmap.c +lib_a_SOURCES += sys/mman/posix_madvise.c +lib_a_SOURCES += sys/mman/shm_open.c +lib_a_SOURCES += sys/mman/shm_unlink.c + if HAS_NETWORKING # methods in <sys/socket.h> lib_a_SOURCES += sys/socket/accept.c diff --git a/testsuites/psxtests/psxhdrs/sys/mman/mlock.c b/testsuites/psxtests/psxhdrs/sys/mman/mlock.c new file mode 100644 index 0000000000..1f7d7b5aee --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/mlock.c @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + + return mlock( addr, len ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/mlockall.c b/testsuites/psxtests/psxhdrs/sys/mman/mlockall.c new file mode 100644 index 0000000000..023c0a40ba --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/mlockall.c @@ -0,0 +1,27 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + int flags = 0; + + return mlockall( flags ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/mmap.c b/testsuites/psxtests/psxhdrs/sys/mman/mmap.c new file mode 100644 index 0000000000..761320042a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/mmap.c @@ -0,0 +1,30 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +void* test( void ); + +void* test( void ) +{ + void *addr = NULL; + size_t len = 0; + int prot = 0, flags = 0, fildes = 0; + off_t off = 0; + + return mmap( addr, len, prot, flags, fildes, off ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/mprotect.c b/testsuites/psxtests/psxhdrs/sys/mman/mprotect.c new file mode 100644 index 0000000000..8b6f423729 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/mprotect.c @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + int prot = 0; + + return mprotect( addr, len, prot ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/msync.c b/testsuites/psxtests/psxhdrs/sys/mman/msync.c new file mode 100644 index 0000000000..c22f145ff2 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/msync.c @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + int flags = 0; + + return msync( addr, len, flags ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/munlock.c b/testsuites/psxtests/psxhdrs/sys/mman/munlock.c new file mode 100644 index 0000000000..df901e1183 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/munlock.c @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + + return munlock( addr, len ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/munlockall.c b/testsuites/psxtests/psxhdrs/sys/mman/munlockall.c new file mode 100644 index 0000000000..2f88ae5b61 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/munlockall.c @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + return munlockall(); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/munmap.c b/testsuites/psxtests/psxhdrs/sys/mman/munmap.c new file mode 100644 index 0000000000..253230a1ac --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/munmap.c @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + + return munmap( addr, len ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/posix_madvise.c b/testsuites/psxtests/psxhdrs/sys/mman/posix_madvise.c new file mode 100644 index 0000000000..59b7d1a043 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/posix_madvise.c @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + void *addr = NULL; + size_t len = 0; + int advice = 0; + + return posix_madvise( addr, len, advice ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/shm_open.c b/testsuites/psxtests/psxhdrs/sys/mman/shm_open.c new file mode 100644 index 0000000000..8db76102cc --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/shm_open.c @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + char *name = "test"; + int oflag = 0; + mode_t mode = 0; + + return shm_open( name, oflag, mode ); +} diff --git a/testsuites/psxtests/psxhdrs/sys/mman/shm_unlink.c b/testsuites/psxtests/psxhdrs/sys/mman/shm_unlink.c new file mode 100644 index 0000000000..182f796cee --- /dev/null +++ b/testsuites/psxtests/psxhdrs/sys/mman/shm_unlink.c @@ -0,0 +1,27 @@ +/* + * 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. + */ + +/* This test file is used to verify that the header files associated with + * invoking this function are correct. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/mman.h> + +int test( void ); + +int test( void ) +{ + char *name = "test"; + + return shm_unlink( name ); +} |