-
- 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);
- return NULL;
- }
- close(fd);
-
- end = map + st.st_size;
- while (end > map && end[-1] != '\n') {