Open System Services System Calls Reference Manual (G06.25+, H06.03+)
link(2) OSS System Calls Reference Manual
Use From the Guardian Environment
The link() function is one of a set of functions that have the following 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.
Use on Guardian Objects
Attempting to create a link to a Guardian file (that is, a file within the /G file system) fails and
causes errno to be set to [EINVAL].
RETURN VALUES
Upon successful completion, the link() function returns the value 0 (zero). If the link() function
fails, the value -1 is returned, no link is created, and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the link( ) function sets errno to the corresponding
value:
[EACCES] The requested link requires writing in a directory with a mode that denies write
permission, or a component of the pathname pointed to by either the path1 or
path2 parameter denies search permission.
[EEXIST] The link named by the path2 parameter already exists.
[EFAULT] Either the path1 or path2 parameter is an invalid address.
[EFSBAD] The fileset catalog for one of the filesets involved in the operation is corrupt.
[EINVAL] The call attempted to create a link to a Guardian file (that is, a file in /G or in any
directory within /G).
[EIO] An input or output error occurred. The device holding the file might be in the
down state, or both processors that provide access to the device might have
failed.
[ELOOP] Too many symbolic links were encountered in translating either the path1 or
path2 parameter.
[EMLINK] The number of links to the file specified by the path1 parameter would exceed
the maximum permitted. The pathconf() function can be called to obtain the
configured limit.
[ENAMETOOLONG]
One of the following is too long:
• The pathname pointed to by the path1 parameter
• The pathname pointed to by the path2 parameter
4−6 Hewlett-Packard Company 527186-003