HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

symlink

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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:

EACCESCAUSEThe calling process does not have search permission to a component of the pathname.
 ACTIONMake sure that the calling process has search permission to all components of the pathname.
ENAMETOOLONGCAUSE

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.

 ACTIONMake sure that both the component's length and the full pathname length do not exceed the {NAME_MAX} or {PATH_MAX} limits.
EEXISTCAUSEThe filenamed by slink already exists.
 ACTIONMake sure the slink does not exist.
ELOOPCAUSEA 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.
 ACTIONMake sure that there is not a loop in the symbolic links that loops more than POSIX_SYMLOOP.
ENOTDIRCAUSEA component of the pathname is not a directory.
 ACTIONSpecify a valid pathname.
ENOSPCCAUSEThe new symbolic link cannot be created because there is no space left on the file system that will contain the symbolic link.
 ACTIONCreate the slink on a writable volume (file system).
EROFSCAUSEThe file slink would reside on a read-only file system.
 ACTIONCreate the slink on a writable volume (file system).

See Also

link(), readlink(), unlink()

Feedback to webmaster