Quote:
Originally Posted by
jim mcnamara
FWIW - directio in Solaris enables direct access that restrictions.
It is restricted to I/O data sizes by disk geometry (sector size) for example.
FWIW, Linux is a lot more restrictive on what it allows for direct IO than Solaris does. At least when comparing Solaris 10 and OpenSolaris to RHEL 5.2/5.3. AFAICT, at those release levels Solaris places no restrictions on the number of bytes transferred, but Linux requires full disk blocks and only full disk blocks.
Earlier versions of Solaris did require a page-aligned buffer, but that's no longer needed. I don't think Linux ever had a buffer alignment restriction for direct IO.
Also, to use direct IO on Linux, you need to open the file with the O_DIRECT flag.
Quote:
A memory mapped (mmap() ) file is as close as you can get to direct I/O for a file on most UNIX systems using system calls like read/write.
I'd characterize mmap()'d IO as more "transparent" to an application than I'd characterize it as "direct". As far as I'm aware, memory-mapped IO pretty much always uses kernel caching of data just like buffered IO does, and that's pretty independent of your flavor of Unix.
Quote:
NOTE: a succesful write call does NOT guarantee that the data will be physically written to a file completely or correctly. See: sync fdatasync or google for 'synchronized I/O data integrity completion'
The reason for this comment is that the OP seems to assume the opposite i.e.,
successful write == successful data synchrony