Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (n - p) open(2)
• 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 Open for synchronized update. If set, updates and writes to regular files are syn-
chronous updates. This flag is ignored for files that are not regular files. File
update is performed by:
• The open() function with the O_TRUNC flag
• The write() function
On return from a call to either of these functions that performs a synchronous
update (a call with the O_SYNC flag set), the calling process is ensured that all
data for the file has been written to permanent storage, even if the file is also
open for deferred update. OSS file-system data caching is disabled for write
operations on files for which this flag is set.
Synchronous updates provide the highest level of data integrity protection but
the slowest performance. Compare with the use of the S_NONSTOP flag, as
described in File Type Flags later in this reference page.
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.
• If the O_NONBLOCK flag is set, the open() function returns an error if no process
currently has the file open for reading.
The O_RDWR file access flag is supported when opening a FIFO file; the call to the open()
function finishes immediately, even if the O_NONBLOCK flag is not set.
When opening a character special file that supports nonblocking opens, such as a terminal dev-
ice:
• If the O_NONBLOCK flag is not set, the open() function blocks until the device is
ready or available.
527186-003 Hewlett-Packard Company 5−7