3 #ifdef __unix__ /* ??? Is that good enough? */
10 #define MAP_ANON MAP_ANONYMOUS
12 #define MAP_ANON MAP_FILE
23 #define MAP_START (void *)0x7fff8000
24 #define MAP_LEN 0x10000
26 #define OFFSET (MAP_LEN/2 - 2 * sizeof (char));
31 for (i
= s
; i
>= 0 && &p
[i
] < &p
[40]; i
++)
43 dev_zero
= open ("/dev/zero", O_RDONLY
);
44 /* -1 is OK when we have MAP_ANON; else mmap will flag an error. */
45 if (INT_MAX
!= 0x7fffffffL
|| sizeof (char *) != sizeof (int))
47 p
= mmap (MAP_START
, MAP_LEN
, PROT_READ
|PROT_WRITE
,
48 MAP_ANON
|MAP_FIXED
|MAP_PRIVATE
, dev_zero
, 0);
54 if (p
[39] != (char)-2)