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

creat(2) OSS System Calls Reference Manual
NAME
creat - Creates a regular le in the OSS environment or rewrites an existing le
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <sys/stat.h> /* optional except for POSIX.1 */
#include <fcntl.h>
int creat(
const char *path,
mode_t mode);
PARAMETERS
path Points to the pathname of the le to be created or opened for writing.
You cannot specify /lost+found, /dev, /dev/tty, and /dev/null for this parameter.
Attempts to create these les cause the function call to fail with errno set to
[EINVAL].
If the path parameter refers to a symbolic link, the creat() function opens the le
pointed to by the symbolic link.
mode Species the read, write, and execute permissions of the le and the le type
ags for the le.
If the le already exists, you must specify a valid value for this parameter, but
this parameter has no effect on the le (you cannot use this parameter to change
the permissions of the le).
The value of this parameter is constructed by logically ORing ags that are
dened in the sys/stat.h header le. If the parent directory of the created le |
does not have default OSS access control list (ACL) entries, the permissions for |
the new le are the bit-wise AND of this mode parameter with the complement |
of the process umask (see the umask(2) reference page). If the parent directory |
of the created le has default ACL entries, the permissions for the new le are |
affected by the value of this parameter but depend on both the support for OSS |
ACLs on the system on which this process is running and on the leset that con- |
tains the new directory. See "ACL Inheritance" in the acl(5) reference page.
The le type ags are described in DESCRIPTION.
DESCRIPTION
This function can create:
OSS les up to a size limit of approximately 2 gigabytes
Guardian Format 1 les up to a size limit of approximately 2 gigabytes
For information about creating larger les, see the creat64(2) reference page.
The creat() 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.
138 Hewlett-Packard Company 527186-007