On Tue, Nov 22, 2011 at 11:32:42AM +0000, Stefan Hajnoczi wrote: > Are you sure POSIX guarantees that O_DIRECT can be changed with > F_SETFL? I didn't find any statement in the specification. It is > possible that this code compiles but does not actually work on > non-Linux OSes. Did you run tests?
O_DIRECT is a non-posix extention, and semantics of it will differ greatly between the operating systems implementing it.