HP 3000 Manuals

symlink [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume I

symlink 

Creates a symbolic link to a file.

Syntax 

     #include <unistd.h>
     init symlink(const char *pname, const char *slink);

Parameters 

pname      Is the pathname contained in the symbolic link.

slink      Is the name of the symbolic link created.

Return Values 

Upon successful completion, the symlink() function will return zero.
Otherwise, a value of -1 will be returned and errno will be set to
indicate the error.

Description 

The symlink function will create a symbolic link called slink, that
contains the pathname specified by pname (slink is the name of the
symbolic link created, pname is the pathname contained in the symbolic
link).

Implementation Considerations 

None.

Errors 

If an error occurs, errno is set to one of the following values:

EACCES            CAUSE           The calling process does not have search permission
                                  to a component of the pathname.
                  ACTION          Make sure that the calling process has search
                                  permission to all components of the pathname.

ENAMETOOLONG      CAUSE           One of the following:
                                     *   The length of the pathname exceeds the
                                         {PATH_MAX} limit (defined in the file
                                         <limits.h>).
                                     *   A component of the pathname is longer than
                                         {NAME_MAX} (defined in <limits.h>), and
                                         {_POSIX_NO_TRUNC} is in effect for that
                                         directory.
                  ACTION          Make sure that both the component's length and the
                                  full pathname length do not exceed the {NAME_MAX} or
                                  {PATH_MAX} limits.

EEXIST            CAUSE           The filenamed by slink already exists.
                  ACTION          Make sure the slink does not exist.

ELOOP             CAUSE           A loop exists in symbolic links encountered during
                                  resolution of the slink argument.  This error may be
                                  returned if more than {POSIX_SYMLOOP} symbolic links
                                  are encountered during resolution of the slink 
                                  argument.
                  ACTION          Make sure that there is not a loop in the symbolic
                                  links that loops more than POSIX_SYMLOOP.

ENOTDIR           CAUSE           A component of the pathname is not a directory.
                  ACTION          Specify a valid pathname.

ENOSPC            CAUSE           The new symbolic link cannot be created because there
                                  is no space left on the file system that will contain
                                  the symbolic link.
                  ACTION          Create the slink on a writable volume (file system).

EROFS             CAUSE           The file slink would reside on a read-only file
                                  system.
                  ACTION          Create the slink on a writable volume (file system).

See Also 

link(), readlink(), unlink()



MPE/iX 5.0 Documentation