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

creat64(2) OSS System Calls Reference Manual
An application call to creat() is automatically mapped to this function when you use the
#dene
_FILE_OFFSET_BITS 64 feature test macro or an equivalent compiler command option to
compile the application.
The creat64() function establishes a connection between the le indicated by the path parameter
and the returned le descriptor. Subsequent I/O function calls, such as read() and write(), use
the opened le descriptor to access that le.
The returned le descriptor is the lowest-numbered
le descriptor not currently open for that pro-
cess. A corresponding Guardian environment le number is also assigned.
The le offset, marking the current position within the le, is set to the beginning of the le. The
new le descriptor is set to remain open across the processing of any of the exec or tdm_exec set
of functions. (See the fcntl(2) reference page.)
A call to the creat64() function is equivalent to this call:
open64( path,O_WRONLY |O_CREAT | O_TRUNC,
mode );
You cannot use the creat() function to create a rst-in, rst-out (FIFO) special le. Use the
mkfo() function instead.
If the le does not exist, a regular le is created with these characteristics:
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 Guardian le (that is, in the /G le system), the group ID is set to
that of the primary group of the effective user ID.
If ACLs are supported, ACL entries are added to the le ACL as described in "ACL |
Inheritance" in the acl(5) reference page.
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 Inheritance" 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 ags are set in the mode
parameter, errno is set to [EINVAL].
If the le exists and is a regular le that is successfully opened:
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 is true:
The le supports enforced record locks, and another process has locked a portion of the
le.
146 Hewlett-Packard Company 527186-007