- fd = open(file, O_RDONLY, 0000);
- if (fd < 0) {
- UNIXERR("open");
- return NULL;
- }
-
- if (fstat(fd, &st) < 0) {
- UNIXERR("fstat");
- close(fd);
- return NULL;
- }
-
- p = map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (map == MAP_FAILED) {
- UNIXERR("mmap");
- close(fd);