fix portability problem in pread