Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (n - p) open(2)
— A structured file
— A file administered through the Storage Management Foundation (SMF)
— Any file or device of any other type not described here
fails with errno set, usually 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 [EISDIR].
• 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 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.
• If the open requires file creation, odd unstructured and file code 180 attributes are
assumed.
• If the open requires file creation, the file is given access permissions of rwxr-xr-x.
During open() processing, all access permissions are checked. This includes Guardian environ-
ment 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 open() 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 open() 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.
527186-003 Hewlett-Packard Company 5−9