Michael Kerrisk wrote:
> > Von: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > /usr/share/man/man2/open.2.gz has (under O_NONBLOCK):
> > "This mode need not have any effect on files other than FIFOs."
> > 
> > I'm almost sure that statement is false.
> > O_NONBLOCK prevents blocking on any filehandle (files, sockets, fifos,
> > devices, ...).
> 
> Justin is on the right track in mentioning the "standard" 
> behavior of O_NONBLOCK.  And you haven't got things quite 
> right -- for example, O_NONBLOCK can't be used for open() with 
> sockets, because we can't open() a socket, and O_NONBLOCK has 
> no meaning for regular files (it is just silently ignored).  

Yes, the de jure standard as susv3 may say is that, but the de facto
standard as _any_ modern UNIX does is the same for every type of file.

> But I agree that the man page is a bit misleading.  One might
> get the impression that, for example, O_NONBLOCK can't be used 
> for sockets, although we can enable O_NONBLOCK on a socket using 
> fcntl().  And O_NONBLOCK does have meaning for some devices,
> and sometimes has an effect for regular files.

O_NONBLOCK _always_ has an effect for regular files, it prevents
blocking on read or write operations (as an example think in NFS or slow
disks)

> I have made the following changes:
> 
> * Removed that sentence from open.2 ;-).
> 
> * Added a sentence noting that the effect of O_NONBLOCK
>   for file locks and leases is described in fcntl.2.
> 
> * Somewhat expanded the discussion of mandatory locking in 
>   fcntl.2.
> 
> The changes will appear in upstream 2.29.

You may always want to attach the patch or an URL for review.

Thanks for these changes. I already knew they were misleading to many
people.



Prueba el Nuevo Correo Terra; Seguro, RĂ¡pido, Fiable.


Reply via email to