Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

documentation/3265: man 2 open doesn't specify ENXIO from O_NONBLOCK

From: <william(at)25thandClement.com>
Date: Mon May 19 2003 - 16:12:25 EDT


>Number: 3265
net
>Environment:

	System      : OpenBSD 3.2
	Architecture: OpenBSD.alpha
	Machine     : alpha

>Description:
open(2) isn't document thoroughly. if you open a named pipe w/ O_WRONLY|O_NONBLOCK, and there's no reader then open returns w/ ENXIO. however, the relevant man page doesn't specify this behavior. If the open() call would result in the process being blocked for some reason (e.g., waiting for carrier on a dialup line), open() returns immediately. ... [ENXIO] The named file is a character special or block special file, and the device associated with this special file does not exist.
>How-To-Repeat:
if (open([fifo w/o reader],O_WRONLY|O_NONBLOCK) == -1) { switch(errno) { case ENXIO: err(1,"well-defined but not documented"); } }
>Fix:
Linux's man 2 page has this: ENXIO O_NONBLOCK | O_WRONLY is set, the named file is a FIFO and no process has the file open for reading. Or, the file is a device special file and no corresponding device exists.

>Release-Note:
Received on Mon May 19 16:30:25 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:57 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library