106 |
|
#endif |
107 |
|
|
108 |
|
/* |
109 |
– |
/* |
109 |
|
* Under Mach there is very little assumed about the memory map of object |
110 |
|
* files. It is the job of the loader to create the initial memory map of an |
111 |
|
* executable. In a Mach-O executable there will be numerous loader commands |
166 |
|
*/ |
167 |
|
addr = mmap(NULL, file_size, PROT_READ | PROT_WRITE, |
168 |
|
MAP_FILE | MAP_SHARED, fd, 0); |
169 |
< |
if (addr == NULL) { |
169 |
> |
if (addr == NULL || addr == MAP_FAILED) { |
170 |
|
(void)fprintf(stderr, "%s: could not mmap %s: %s\n", |
171 |
|
progname, filename, strerror(errno)); |
172 |
|
exit(1); |