Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (n - p) open(2)
The file status flags that define the initial state of the open file are:
O_APPEND Open the file only for append access. If set, the file pointer is set to the end of
the file before each write.
This flag is ignored for Telserv terminal devices.
O_NONBLOCK
Open the file for nonblocked access. If set, the call to open() does not block,
and subsequent read() or write() operations on the file are nonblocking.
When opening a regular disk file or an OSS directory, the O_NONBLOCK flag
is ignored.
Calling the open() function with the O_NONBLOCK flag for FIFO files and for
character special devices that support nonblocking opens is supported.
Calling the open() function with the O_NONBLOCK flag is supported for Tel-
serv terminal devices (tty) as listed:
• For a static window, the open operation is always allowed; it finishes
when the connection is established.
• For a dynamic window, the open operation is allowed only if a connec-
tion is already established.
Calling the open() function with the O_NONBLOCK flag is supported for
OSSTTY terminal devices (ztty). OSSTTY devices support only three static
windows, one each for #stdin, #stdout, and #stderr.
O_SYNC The O_SYNC flag provides a high level of data integrity for writes to regular |
files. For HP NonStop systems, you can use the OSS Monitor to select one of |
multiple levels of fault tolerance. For more information, see the discussion of the |
FTIOMODE attribute in the Open System Services Management and Operations |
Guide.
General Notes on oflag Parameter Flag Values
The effect of setting the O_CREAT flag is immediate.
When opening a file with the O_CREAT flag set:
• If the named file does not already exist, a regular disk file is created.
• If the named file is not a regular file, the O_CREAT flag is ignored.
When opening a FIFO file with the O_RDONLY flag set:
• If the O_NONBLOCK flag is not set, the open() function blocks until another process
opens the file for writing. If the file is already open for writing (even by the calling pro-
cess), the function returns without delay.
• If the O_NONBLOCK flag is set, the open() function returns immediately.
When opening a FIFO file with the O_WRONLY flag set:
• If the O_NONBLOCK flag is not set, the open() function blocks until another process
opens the file for reading. If the file is already open for reading (even by the calling pro-
cess), the function returns without delay.
527186-007 Hewlett-Packard Company 5−7