136 |
|
return -1; |
137 |
|
|
138 |
|
// Since I don't know the standard behavior of mmap(), zero-fill here |
139 |
< |
if (memset(0, 0, size) != 0) |
139 |
> |
if (memset(addr, 0, size) != 0) |
140 |
|
return -1; |
141 |
|
#else |
142 |
|
// Unsupported |
146 |
|
|
147 |
|
// Explicitely protect the newly mapped region here because on some systems, |
148 |
|
// say MacOS X, mmap() doesn't honour the requested protection flags. |
149 |
< |
if (vm_protect(0, size, VM_PAGE_DEFAULT) != 0) |
149 |
> |
if (vm_protect(addr, size, VM_PAGE_DEFAULT) != 0) |
150 |
|
return -1; |
151 |
|
|
152 |
|
return 0; |