2015-12-17 17:56:48 +00:00
/*
2016-01-05 23:07:59 +00:00
* Copyright ( c ) 2015 - 2016 Dmitry V . Levin < ldv @ altlinux . org >
2017-05-22 19:14:52 +02:00
* Copyright ( c ) 2015 - 2017 The strace developers .
2015-12-17 17:56:48 +00:00
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions
* are met :
* 1. Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
* 2. Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the distribution .
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission .
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS ' ' AND ANY EXPRESS OR
* IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED .
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT , INDIRECT ,
* INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT
* NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE ,
* DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
*/
2016-01-02 13:28:43 +00:00
# include "tests.h"
2015-03-19 22:03:32 +00:00
# include <stdio.h>
# include <stdint.h>
# include <unistd.h>
# include <limits.h>
# include <sys/mman.h>
int
2016-02-12 01:56:10 +00:00
main ( int ac , char * * av )
2015-03-19 22:03:32 +00:00
{
2016-02-12 01:56:10 +00:00
const char * const name = ac > 1 ? av [ 1 ] : " mmap " ;
2016-01-05 23:07:59 +00:00
const intmax_t pagesize = get_page_size ( ) ;
2016-02-12 01:56:10 +00:00
const unsigned long length1 = pagesize * 6 ;
const unsigned long length2 = pagesize * 3 ;
const unsigned long length3 = pagesize * 2 ;
2015-03-19 22:03:32 +00:00
const int fd = - 1 ;
off_t offset ;
void * addr , * p ;
# if ULONG_MAX > 4294967295UL
2016-11-13 19:14:46 +03:00
offset = 0xcafedeadbeef000ULL & - pagesize ;
2015-03-19 22:03:32 +00:00
addr = ( void * ) ( uintmax_t ) ( 0xfacefeed000 & - pagesize ) ;
# else
2016-11-13 19:14:46 +03:00
offset = 0xdeadbeef000ULL & - pagesize ;
2015-03-19 22:03:32 +00:00
addr = ( void * ) ( unsigned int ) ( 0xfaced000 & - pagesize ) ;
# endif
2016-02-12 01:56:10 +00:00
const uintmax_t uoffset =
sizeof ( offset ) = = sizeof ( int ) ? ( uintmax_t ) ( unsigned int ) offset
: ( uintmax_t ) offset ;
2015-03-19 22:03:32 +00:00
2016-02-12 01:56:10 +00:00
( void ) close ( 0 ) ;
( void ) close ( 0 ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " %s(NULL, 0, %#x, %#x, 0, 0) = -1 EBADF (%m) \n " ,
name , PROT_NONE , MAP_FILE ) ;
# elif XLAT_VERBOSE
printf ( " %s(NULL, 0, %#x /* PROT_NONE */, %#x /* MAP_FILE */, 0, 0) "
" = -1 EBADF (%m) \n " ,
name , PROT_NONE , MAP_FILE ) ;
# else
2016-02-12 01:56:10 +00:00
printf ( " %s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m) \n " ,
name ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2016-02-12 01:56:10 +00:00
mmap ( NULL , 0 , PROT_NONE , MAP_FILE , 0 , 0 ) ;
p = mmap ( addr , length1 , PROT_READ | PROT_WRITE ,
2015-03-19 22:03:32 +00:00
MAP_PRIVATE | MAP_ANONYMOUS , fd , offset ) ;
2016-01-05 23:07:59 +00:00
if ( MAP_FAILED = = p )
perror_msg_and_fail ( " mmap " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " %s(%p, %lu, %#x, "
" %#x|%#x, %d, %#jx) = %p \n " ,
name , addr , length1 , PROT_READ | PROT_WRITE , MAP_PRIVATE ,
MAP_ANONYMOUS , fd , uoffset , p ) ;
# elif XLAT_VERBOSE
printf ( " %s(%p, %lu, %#x /* PROT_READ|PROT_WRITE */, "
" %#x /* MAP_PRIVATE */|%#x /* MAP_ANONYMOUS */, %d, %#jx) "
" = %p \n " ,
name , addr , length1 , PROT_READ | PROT_WRITE , MAP_PRIVATE ,
MAP_ANONYMOUS , fd , uoffset , p ) ;
# else
2016-02-12 01:56:10 +00:00
printf ( " %s(%p, %lu, PROT_READ|PROT_WRITE, "
" MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p \n " ,
name , addr , length1 , fd , uoffset , p ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2016-02-12 01:56:10 +00:00
if ( msync ( p , length1 , MS_SYNC ) )
perror_msg_and_fail ( " msync " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " msync(%p, %lu, %#x) = 0 \n " , p , length1 , MS_SYNC ) ;
# elif XLAT_VERBOSE
printf ( " msync(%p, %lu, %#x /* MS_SYNC */) = 0 \n " , p , length1 , MS_SYNC ) ;
# else
2016-02-12 01:56:10 +00:00
printf ( " msync(%p, %lu, MS_SYNC) = 0 \n " , p , length1 ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2016-02-12 01:56:10 +00:00
if ( mprotect ( p , length1 , PROT_NONE ) )
2016-01-05 23:07:59 +00:00
perror_msg_and_fail ( " mprotect " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " mprotect(%p, %lu, %#x) = 0 \n " , p , length1 , PROT_NONE ) ;
# elif XLAT_VERBOSE
printf ( " mprotect(%p, %lu, %#x /* PROT_NONE */) = 0 \n " ,
p , length1 , PROT_NONE ) ;
# else
2016-02-12 01:56:10 +00:00
printf ( " mprotect(%p, %lu, PROT_NONE) = 0 \n " , p , length1 ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2016-02-12 01:56:10 +00:00
addr = mremap ( p , length1 , length2 , 0 ) ;
if ( MAP_FAILED = = addr )
perror_msg_and_fail ( " mremap " ) ;
printf ( " mremap(%p, %lu, %lu, 0) = %p \n " , p , length1 , length2 , addr ) ;
p = mremap ( addr , length2 , length3 , MREMAP_MAYMOVE | MREMAP_FIXED ,
addr + length2 ) ;
if ( MAP_FAILED = = p )
perror_msg_and_fail ( " mremap " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " mremap(%p, %lu, %lu, %#x, %p) = %p \n " ,
addr , length2 , length3 , MREMAP_MAYMOVE | MREMAP_FIXED ,
addr + length2 , p ) ;
# elif XLAT_VERBOSE
printf ( " mremap(%p, %lu, %lu, %#x /* MREMAP_MAYMOVE|MREMAP_FIXED */ "
" , %p) = %p \n " ,
addr , length2 , length3 , MREMAP_MAYMOVE | MREMAP_FIXED ,
addr + length2 , p ) ;
# else
2016-02-12 01:56:10 +00:00
printf ( " mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED "
" , %p) = %p \n " , addr , length2 , length3 , addr + length2 , p ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2016-02-12 01:56:10 +00:00
if ( munmap ( p , length3 ) )
2016-01-05 23:07:59 +00:00
perror_msg_and_fail ( " munmap " ) ;
2016-02-12 01:56:10 +00:00
printf ( " munmap(%p, %lu) = 0 \n " , p , length3 ) ;
if ( mlockall ( MCL_FUTURE ) )
perror_msg_and_fail ( " mlockall " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# if XLAT_RAW
printf ( " mlockall(%#x) = 0 \n " , MCL_FUTURE ) ;
# elif XLAT_VERBOSE
printf ( " mlockall(%#x /* MCL_FUTURE */) = 0 \n " , MCL_FUTURE ) ;
# else
2016-02-12 01:56:10 +00:00
puts ( " mlockall(MCL_FUTURE) = 0 " ) ;
tests: add mmap/mmap64 variants different xlat verbosity levels
* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
* tests/mmap-Xabbrev.c: New file.
* tests/mmap-Xraw.c: Likewise.
* tests/mmap-Xverbose.c: Likewise.
* tests/mmap64-Xabbrev.c: Likewise.
* tests/mmap64-Xraw.c: Likewise.
* tests/mmap64-Xverbose.c: Likewise.
* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
* tests/mmap.test: Add handling of optional test arguments that set
alignment and xlat verbosity options.
* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-04-04 17:38:53 +02:00
# endif
2015-03-19 22:03:32 +00:00
2016-02-12 01:56:10 +00:00
puts ( " +++ exited with 0 +++ " ) ;
2015-03-19 22:03:32 +00:00
return 0 ;
}