Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (a - d) creat(2)
Opening Guardian Files
If the le is a Guardian le (that is, a le in the /G le system), these rules apply:
The le can be opened only if it is one of these:
An odd, unstructured Enscribe le. In this case, it is opened as a regular le with
a primary and secondary extent size that is a multiple of 2. If the extent size is
odd, the open fails.
If the unstructured buffer size was not 4096, a successful open makes the buffer
size 4096 (as if the Guardian procedure SETMODE was called for mode 93 with
a parameter value of 4096).
An EDIT le (le code 101). In this case, it is opened as a regular le for read-
only access.
A tty simulation process.
An attempt to open any le (or device) of any other type fails, and errno is set to the
value of [EINVAL]. An attempt to open a volume, subvolume, or process (/G/vol,
/G/vol/subvol,or/G/process, respectively) fails, and errno is set to the value of [EIS-
DIR].
An attempt to open a subvolume with a reserved name beginning with "ZYQ" (for exam-
ple, /G/vol2/zyq00004) fails, and errno is set to the value of [EACCES].
An attempt to open a le within a subvolume with a reserved name beginning with
"ZYQ" (for example, /G/vol2/zyq00004/z000002x) fails, and errno is set to the value of
[EACCES].
If the le is not an EDIT le (that is, the le code is not 101), it is opened in shared
exclusion mode.
If the le is an EDIT le and read-only access is specied, the le is opened in protected
exclusion mode in the Guardian environment.
If the le is an EDIT le and write access is specied, 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 le segment (PFS) and the number of existing opens on directories or on les in
the Guardian environment.
If the open causes le creation, odd unstructured and le code 180 attributes are
assumed.
If the open causes le creation, the le 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 le and process access.
527186-003 Hewlett-Packard Company 133