sudheer wrote
>>> B. will the process be returned after scheduling the writing (say
>>> after passing the data to the elevator)? If this case is true, how
>>> would the process ensure that the data has been actually written on to
>>> the block device?

To ensure the data hit the disk you need to pass O_SYNC flag while opening
the file.
see open(2m).

regards,
ajit jain

On Wed, Jun 30, 2010 at 8:36 PM, Michael Blizek <
mic...@michaelblizek.twilightparadox.com> wrote:

> Hi!
>
> On 09:02 Wed 30 Jun     , Sudheer wrote:
> ...
> > Thanks for the comments. In this case, is there any difference in
> > invoking 'write' with O_NONBLOCK flag set and without O_NONBLOCK?.
> >
> > >From the man page it looks like that the O_NONBLOCK is used to
> > determine whether or not to block the process if it tries to access a
> > 'locked' region. Means it doesn't have any effect in 'write' system
> > call?
>
> No, O_NONBLOCK does not have any effect when the data hits the disks, it
> only
> defines the behaviour when the kernel buffers are full. See my other reply
> on
> kernelnewbies.
>
>        -Michi
> --
> programing a layer 3+4 network protocol for mesh networks
> see http://michaelblizek.twilightparadox.com
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

Reply via email to