Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

symlink(2) OSS System Calls Reference Manual
readlink() This function applies only to symbolic links.
remove() A symbolic link can be removed by invoking the remove() function.
rename() If the file to be renamed is a symbolic link, the symbolic link is renamed. If the
new name refers to an existing symbolic link, the symbolic link is destroyed.
rmdir() An error is returned if a symbolic link is named as the path parameter.
unlink() A symbolic link can be removed by invoking unlink( ).
Execute (search) permission for the directories within a symbolic link are required to traverse the
resolved pathname. Normal permission checks are made on each component of the symbolic link
pathname during its resolution.
Use on Guardian Objects
The symlink() function can be used to create a symbolic link between an OSS fileset and an
object in the Guardian file system (/G). Symbolic links cannot be created in /G.
Use From the Guardian Environment
The symlink() function can be used by a Guardian process when the process has been compiled
using the #define _XOPEN_SOURCE_EXTENDED 1 feature-test macro or an equivalent com-
piler command option.
The symlink() 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.
NOTES
An absolute pathname that includes a symbolic link for an OSS file on a remote HP NonStop
node is expanded relative to the root fileset of the remote node. For example, if path1 is specified
as /usr/bin and path2 is specified as link, then a reference to /E/node1/link is expanded to
/E/node1/usr/bin and identifies the /usr/bin directory on the HP NonStop node named NODE1.
RETURN VALUES
Upon successful completion, the symlink( ) function returns the value 0 (zero). Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the symlink( ) function sets errno to the corresponding
value:
[EACCES] One of the following conditions exists:
The requested operation requires writing in a directory with a mode that
denies write permission.
7534 Hewlett-Packard Company 527186-023