Open System Services System Calls Reference Manual (G06.25+, H06.03+)

open(2) OSS System Calls Reference Manual
O_EXCL Open the le in exclusive access mode.
If the le exists and the O_EXCL and O_CREAT ags are set, the open fails. If
the le exists and the O_EXCL ag is set and the O_CREAT ag is not set, the
open succeeds.
O_NOCTTY Open the le but not as a controlling terminal. If the path parameter identies a
terminal device, this ag ensures that the terminal device does not become the
controlling terminal for the process.
When opening a le that is not a terminal device, the O_NOCTTY ag is
ignored.
O_TRUNC Open the le and empty it. If the le does not exist or if the le is not a regular
le, this ag has no effect. If the le exists and is a regular le, and if the le is
successfully opened with either read/write access or write-only access, then:
The length of the le is truncated to 0 (zero).
The owner and group of the le are unchanged.
The set user ID attribute of the le mode is cleared.
The open fails if any of these conditions are true:
The le supports enforced record locks, and another process has locked a
portion of the le.
The le does not allow write access.
The oag parameter also species the O_RDONLY ag.
If the oag parameter also species the O_SYNC ag, the truncation is a syn-
chronous update.
A program can request some control over when updates should be made per-
manent for a regular le opened for write access.
The le status ags that dene the initial state of the open le are:
O_APPEND Open the le only for append access. If set, the le pointer is set to the end of
the le before each write.
This ag is ignored for Telserv terminal devices.
O_NONBLOCK
Open the le for nonblocked access. If set, the call to open() does not block,
and subsequent read() or write() operations on the le are nonblocking.
When opening a regular disk le or an OSS directory, the O_NONBLOCK ag
is ignored.
Calling the open() function with the O_NONBLOCK ag for FIFO les and for
character special devices that support nonblocking opens is supported.
Calling the open() function with the O_NONBLOCK ag is supported for Tel-
serv terminal devices (tty) as listed:
For a static window, the open operation is always allowed; it nishes
when the connection is established.
56 Hewlett-Packard Company 527186-003