Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (a - d) creat(2)
• If the file is an EDIT file and write access is specified, the call fails, and errno is set to
the value [EINVAL].
• The maximum number of opens is reported by the sysconf() function as the upper limit
of opens per process. The actual limit depends on other factors, such as the size of the
process file segment (PFS) and the number of existing opens on directories or on files in
the Guardian environment.
• When the Guardian file id created, it will be Format 1, odd, unstructured, and
file code
180.
• The file is given access permissions compatible with the standard security permissions
for the Guardian creator access ID (CAID) of the calling process.
During creat() function processing, all access permissions are checked. This includes Guardian
environment checks by Guardian standard security mechanisms (and by the Safeguard product)
for Guardian disk file and process access.
Use From the Guardian Environment
A call to the creat() function in the Guardian environment requires an OSS pathname and
returns an OSS file-system file descriptor, regardless of the file system containing the file.
The creat() function belongs to a set of functions that have these effects when the first of them is
called from the Guardian environment:
• Two Guardian file-system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
• The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
• The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
RETURN VALUES
Upon successful completion, the creat() function returns the file descriptor, a nonnegative
integer. Otherwise, the value -1 is returned, and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the function sets errno to the corresponding value:
[EACCES] One of these conditions exists:
• Search permission is denied on a component of the pathname prefix.
• The file does not exist, and write permission is denied for the parent
directory.
• The process attempted to open a Guardian subvolume with a reserved
name beginning with "ZYQ" or a file within such a subvolume.
• The process attempted to open a static Telserv window that is not yet
connected.
527186-007 Hewlett-Packard Company 1−41