96 |
|
return VM_MAP_FAILED; |
97 |
|
#else |
98 |
|
#ifdef HAVE_MMAP_VM |
99 |
< |
if ((addr = mmap(next_address, size, VM_PAGE_DEFAULT, map_flags, zero_fd, 0)) == MAP_FAILED) |
99 |
> |
if ((addr = mmap((caddr_t)next_address, size, VM_PAGE_DEFAULT, map_flags, zero_fd, 0)) == MAP_FAILED) |
100 |
|
return VM_MAP_FAILED; |
101 |
|
|
102 |
|
next_address = (char *)addr + size; |
132 |
|
return -1; |
133 |
|
#else |
134 |
|
#ifdef HAVE_MMAP_VM |
135 |
< |
if (mmap(addr, size, VM_PAGE_DEFAULT, map_flags | MAP_FIXED, zero_fd, 0) == MAP_FAILED) |
135 |
> |
if (mmap((caddr_t)addr, size, VM_PAGE_DEFAULT, map_flags | MAP_FIXED, zero_fd, 0) == MAP_FAILED) |
136 |
|
return -1; |
137 |
|
|
138 |
|
// Since I don't know the standard behavior of mmap(), zero-fill here |
166 |
|
return -1; |
167 |
|
#else |
168 |
|
#ifdef HAVE_MMAP_VM |
169 |
< |
if (munmap(addr, size) != 0) |
169 |
> |
if (munmap((caddr_t)addr, size) != 0) |
170 |
|
return -1; |
171 |
|
#else |
172 |
|
free(addr); |
186 |
|
return ret_code == KERN_SUCCESS ? 0 : -1; |
187 |
|
#else |
188 |
|
#ifdef HAVE_MMAP_VM |
189 |
< |
int ret_code = mprotect(addr, size, prot); |
189 |
> |
int ret_code = mprotect((caddr_t)addr, size, prot); |
190 |
|
return ret_code == 0 ? 0 : -1; |
191 |
|
#else |
192 |
|
// Unsupported |