Linux: fix reading files larger than the chunk size