- /* In case NBYTES is greater than BUFLEN, we read BUFLEN+1 bytes.
- This might overflow the buffer but the damage is reduced to just
- one byte. And the program will terminate right away. */
- ssize_t n = __pread (fd, buf, offset, MIN (nbytes, buflen + 1));
- if (n > 0 && (size_t) n > buflen)