Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (a - d) creat(2)
NAME
creat - Creates a regular file in the OSS environment or rewrites an existing file
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-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 file 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 files 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 file
pointed to by the symbolic link.
mode Specifies the read, write, and execute permissions of the file and the file type
flags for the file.
If the file already exists, you must specify a valid value for this parameter, but
this parameter has no effect on the file (you cannot use this parameter to change
the permissions of the file).
The value of this parameter is constructed by logically ORing flags that are
defined in the sys/stat.h header file. If the parent directory of the created file
does not have default OSS access control list (ACL) entries, the permissions for
the new file 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 file has default ACL entries, the permissions for the new file 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 fileset that con-
tains the new directory. See "ACL Inheritance" in the acl(5) reference page.
The file type flags are described in DESCRIPTION.
DESCRIPTION
This function can create:
OSS files up to a size limit of approximately 2 gigabytes
Guardian Format 1 files up to a size limit of approximately 2 gigabytes
For information about creating larger files, see the creat64(2) reference page.
The creat() function establishes a connection between the file indicated by the path parameter
and the returned file descriptor. Subsequent I/O function calls, such as read() and write( ), use
the opened file descriptor to access that file.
527186-023 Hewlett-Packard Company 143