On Wed, 2007-06-20 at 09:22 -0700, Ray Lee wrote: > On 6/20/07, Timo Sirainen <[email protected]> wrote: > > On Wed, 2007-06-20 at 17:52 +0300, Timo Sirainen wrote: > > > Sometimes read() returns only 4096 bytes. I'm locking the file, so I > > > don't think this should ever happen, right? > > man 2 read > > read() is always allowed to return less than you asked for. You need > to go back and ask for the rest. That's why people wrap read() and > write() in loops, and use those wrapped versions instead. I thought this wouldn't happen when reading from local filesystems. Anyway, my real program was doing that, and it was still seeing partial data. But looks like I can't reproduce it in my test program with two pread()s, so I'll have to do some more debugging.
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- Re: SMP read() stopping at memory page boundaries
- From: Alan Cox <[email protected]>
- Re: SMP read() stopping at memory page boundaries
- References:
- SMP read() stopping at memory page boundaries
- From: Timo Sirainen <[email protected]>
- Re: SMP read() stopping at memory page boundaries
- From: Timo Sirainen <[email protected]>
- Re: SMP read() stopping at memory page boundaries
- From: "Ray Lee" <[email protected]>
- SMP read() stopping at memory page boundaries
- Prev by Date: Re: [BUG] ide dma_timer_expiry, then hard lockup
- Next by Date: Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
- Previous by thread: Re: SMP read() stopping at memory page boundaries
- Next by thread: Re: SMP read() stopping at memory page boundaries
- Index(es):