Open System Services System Calls Reference Manual (G06.28+, H06.05+)

open64(2) OSS System Calls Reference Manual
File Status Flags
The le status ags that specify special open processing are:
O_CREAT Create and open the le. If the le exists, this ag has no effect except as noted
under the O_EXCL ag. If the le does not exist, a regular le is created with
these characteristics:
If access control lists (ACLs) are supported, ACL entries are added to |
the le ACL as described in "ACL Inheritance" in the
acl(5) reference |
page.
The owner ID of the le is set to the effective user ID of the process.
The group ID of the le is determined by the value of the S_ISGID ag
in the parent directory. If S_ISGID is set, the group ID of the le is set to
the group ID of the parent directory; otherwise, the group ID of the le is
set to the effective group ID of the calling process. If the le is a Guar-
dian le (that is, within /G), the group ID is set to that of the primary
group of the effective user ID.
The le permission and attribute bits are set to the value of the mode
parameter, modied as listed:
The le permission bits are set as described in "ACL Inheri- |
tance" in the acl(5) reference page.
The set user ID attribute (S_ISUID bit) is cleared.
The set group ID attribute (S_ISGID bit) is cleared.
If bits other than the le permission and appropriate le-type bits are set
in the mode parameter, errno is set to [EINVAL].
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:
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.
516 Hewlett-Packard Company 527186-007