The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Understanding read/write and kernel interaction Krothos UNIX for Dummies Questions & Answers 1 09-16-2009 11:09 PM
Find all files with group read OR group write OR user write permission shunter63 Shell Programming and Scripting 5 01-14-2009 01:06 PM
sed to read and write to very same file 435 Gavea Shell Programming and Scripting 5 06-30-2006 12:04 AM
popening for read and write szzz High Level Programming 1 11-18-2003 12:05 PM
read, write & STDOUT_FILENO.... M3xican High Level Programming 2 07-17-2002 05:41 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-17-2009
achenle achenle is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 80
Quote:
Originally Posted by jim mcnamara View Post
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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0