Fix compilation on FreeBSD. extracted from patch by Doug Rabson <dfr@nlsystems.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2167
This commit is contained in:
Dirk Mueller 2004-01-03 14:18:02 +00:00
parent acad7cdb9e
commit 1811b4b5c0
11 changed files with 16 additions and 16 deletions

View File

@ -14,7 +14,7 @@
void* get_superblock(void) void* get_superblock(void)
{ {
void* p = mmap( 0, SUPERBLOCK_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, void* p = mmap( 0, SUPERBLOCK_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 ); MAP_PRIVATE|MAP_ANON, -1, 0 );
assert(p != ((void*)(-1))); assert(p != ((void*)(-1)));

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
./filter_stderr | ./filter_stderr |
sed "s/malloc\/free: in use at exit: [0-9]\+ bytes in [0-9]\+ blocks./malloc\/free: in use at exit: ... bytes in ... blocks./" | sed "s/malloc\/free: in use at exit: [0-9]* bytes in [0-9]* blocks./malloc\/free: in use at exit: ... bytes in ... blocks./" |
sed "s/malloc.free: [0-9]\+ allocs, [0-9]\+ frees, [0-9]\+ bytes allocated./malloc\/free: ... allocs, ... frees, ... bytes allocated./" sed "s/malloc.free: [0-9]* allocs, [0-9]* frees, [0-9]* bytes allocated./malloc\/free: ... allocs, ... frees, ... bytes allocated./"

View File

@ -1,4 +1,4 @@
#! /bin/sh #! /bin/sh
./filter_stderr | ./filter_stderr |
sed "s/checked [0-9]\+ bytes./checked ... bytes./" sed "s/checked [0-9]* bytes./checked ... bytes./"

View File

@ -8,7 +8,7 @@ $dir/../../tests/filter_stderr_basic |
$dir/../../tests/filter_addresses | $dir/../../tests/filter_addresses |
# Anonymise line numbers in mac_replace_strmem.c # Anonymise line numbers in mac_replace_strmem.c
sed "s/mac_replace_strmem.c:[0-9]\+/mac_replace_strmem.c:.../" | sed "s/mac_replace_strmem.c:[0-9]*/mac_replace_strmem.c:.../" |
$dir/../../tests/filter_test_paths | $dir/../../tests/filter_test_paths |

View File

@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
int main () int main ()
{ {

View File

@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
int gcc_cant_inline_me ( int ); int gcc_cant_inline_me ( int );

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include "../memcheck.h" #include "../memcheck.h"
/* Program demonstrating copying of metadata in memcheck. */ /* Program demonstrating copying of metadata in memcheck. */

View File

@ -1,5 +1,5 @@
#include <malloc.h> #include <stdlib.h>
int main ( void ) int main ( void )
{ {

View File

@ -3,7 +3,7 @@
realloc time due to bad ordering of the things happening. Now runs realloc time due to bad ordering of the things happening. Now runs
without error. */ without error. */
#include <malloc.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
int main ( void ) int main ( void )

View File

@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include <sys/mman.h> #include <sys/mman.h>
@ -15,7 +15,7 @@ int main(int argv, char** argc) {
stack_t sigstk; stack_t sigstk;
struct sigaction act; struct sigaction act;
static const int size = SIGSTKSZ*2; static const int size = SIGSTKSZ*2;
char *stk = (char *)mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); char *stk = (char *)mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
sigstk.ss_sp = stk; sigstk.ss_sp = stk;
sigstk.ss_size = size; sigstk.ss_size = size;

View File

@ -12,25 +12,25 @@ int main(void)
{ {
/* mmap(0x0, ... FIXED) should fail */ /* mmap(0x0, ... FIXED) should fail */
int* m = mmap(0x0, 1000000, PROT_READ|PROT_WRITE, int* m = mmap(0x0, 1000000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m != (int*)-1) if (m != (int*)-1)
printf("succeeded?!\n"); printf("succeeded?!\n");
/* mmap(0x1000, ... FIXED) should fail */ /* mmap(0x1000, ... FIXED) should fail */
m = mmap((void*)0x1000, 1000000, PROT_READ|PROT_WRITE, m = mmap((void*)0x1000, 1000000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m != (int*)-1) if (m != (int*)-1)
printf("succeeded?!\n"); printf("succeeded?!\n");
/* mmap(0xa000, ... FIXED) should fail */ /* mmap(0xa000, ... FIXED) should fail */
m = mmap((void*)0xa000, 1000000, PROT_READ|PROT_WRITE, m = mmap((void*)0xa000, 1000000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m != (int*)-1) if (m != (int*)-1)
printf("succeeded?!\n"); printf("succeeded?!\n");
/* mmap(0x10000, ... FIXED) should fail */ /* mmap(0x10000, ... FIXED) should fail */
m = mmap((void*)0x10000, 1000000, PROT_READ|PROT_WRITE, m = mmap((void*)0x10000, 1000000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m == (int*)-1) if (m == (int*)-1)
printf("failed?!\n"); printf("failed?!\n");