1 /* this tests whether we can use mremap */
3 #if defined(HAVE_UNISTD_H)
10 #include <sys/types.h>
14 #define DATA "conftest.mmap"
21 #define MAP_FAILED (int *)-1
30 fd
= open(DATA
, O_RDWR
|O_CREAT
|O_TRUNC
, 0666);
35 buf
= (int *)mmap(NULL
, 0x1000, PROT_READ
| PROT_WRITE
,
36 MAP_FILE
| MAP_SHARED
, fd
, 0);
37 if (buf
== MAP_FAILED
) {
41 buf
= mremap(buf
, 0x1000, 0x2000, MREMAP_MAYMOVE
);
42 if (buf
== MAP_FAILED
) {