Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (n - p) open(2)
Opening Guardian Files
If the file is a Guardian file (that is, if it is in the /G file system):
• The file can be opened only if it is:
— A Format 1 file or a Format 2 file that is smaller than 2 gigabytes, on a physical
disk volume, and either:
— An odd, unstructured Enscribe file. In this case, it is opened as a regular
file 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 file (file code 101). In this case, it is opened as a regular file
for read-only access.
— A Telserv or OSSTTY terminal process.
You cannot use the open() function on any other type of Guardian object. An attempt to
open:
— A Format 2 file that is larger than approximately 2 gigabytes fails with errno set
to [EOVERFLOW].
— A structured file fails with errno set, usually to [EINVAL].
— A file administered through the Storage Management Foundation (SMF) fails
with errno set to [ENOTSUP].
— Any file or device of any other type not described here fails with errno set, usu-
ally to [EINVAL].
An attempt to open a volume, a subvolume, or a process other than a TTY simulation
process (/G/vol, /G/vol/subvol,or/G/process, respectively) fails with errno set to [EIS-
DIR].
• An attempt to open a subvolume with a reserved name beginning with ZYQ (for exam-
ple, /G/vol2/zyq00004) fails with errno set to [EACCES].
• An attempt to open a file within a subvolume with a reserved name beginning with ZYQ
(for example, /G/vol2/zyq00004/z000002x) fails with errno set to [EACCES].
• If the file is not an EDIT file (that is, the file code is not 101), it is opened in shared
exclusion mode.
• If the file is an EDIT file and read-only access is specified, the file is opened in protected
exclusion mode in the Guardian environment.
• If the file is an EDIT file and write access is specified, the call fails with errno set to
[EINVAL].
• The sysconf() function reports the maximum number of opens as the upper limit of
opens per process. The actual limit depends on other factors, such as the size of the pro-
cess file segment (PFS) and the number of existing opens on directories or on files in the
Guardian environment.
527186-023 Hewlett-Packard Company 5−9