mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
seem to be simply duplication of the x86 instruction set tests into the addrcheck and helgrind trees. I'm not sure what this duplication achieves. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3264
48 lines
872 B
C
48 lines
872 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/mman.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
void *p1;
|
|
void *p2;
|
|
|
|
if ( ( p1 = mmap( 0, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0 ) ) == MAP_FAILED )
|
|
{
|
|
perror( "mmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( munmap( p1, 4096 ) != 0 )
|
|
{
|
|
perror( "munmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( ( p2 = mmap( p1 + 1, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0 ) ) == MAP_FAILED )
|
|
{
|
|
perror( "mmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( munmap( p2, 4096 ) != 0 )
|
|
{
|
|
perror( "munmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( ( p2 = mmap( p1 + 1, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0 ) ) == MAP_FAILED )
|
|
{
|
|
perror( "mmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
if ( munmap( p2, 4096 ) != 0 )
|
|
{
|
|
perror( "munmap" );
|
|
exit( 1 );
|
|
}
|
|
|
|
exit( 0 );
|
|
}
|