Am Donnerstag, den 26.03.2009, 10:08 +0100 schrieb Alexandre Julliard:
- The FILE_NO_INTERMEDIATE_BUFFER flag seemed to require the O_DIRECT
flag during the Unix open. This was proven by having standard Linux code access the device. #1/10 and #9/10 fixed this.
I don't see why you'd need O_DIRECT.
O_DIRECT avoids buffering in the Linux kernel. If that dumb device makes "block-mapped I/O", i.e. uses read/write requests to perform *actions* on that device, buffering renders the communication unusable.
- Linux requires the I/O buffer for special files (/dev/..) to be
aligned on 512 byte boundary to get the correct data. #4/10 corrects that problem for both reading and writing.
That's really ugly.
That's only the case if the device has been opened with O_DIRECT. For buffered read/write, no alignment is needed.
Regards, Michael Karcher