[9] | 1 | .TH SYMLINK 2 "March 17, 2006"
|
---|
| 2 | .UC 4
|
---|
| 3 | .SH NAME
|
---|
| 4 | symlink \- make a symbolic link to a file
|
---|
| 5 | .SH SYNOPSIS
|
---|
| 6 | .nf
|
---|
| 7 | .ft B
|
---|
| 8 | #include <unistd.h>
|
---|
| 9 |
|
---|
| 10 | int symlink(const char *\fIname1\fP, const char *\fIname2\fP)
|
---|
| 11 | .fi
|
---|
| 12 | .ft R
|
---|
| 13 | .SH DESCRIPTION
|
---|
| 14 | A symbolic link
|
---|
| 15 | .I name2
|
---|
| 16 | is created.
|
---|
| 17 | The link has the name
|
---|
| 18 | .IR name1 .
|
---|
| 19 | .SH "RETURN VALUE
|
---|
| 20 | Upon successful completion, a value of 0 is returned. Otherwise,
|
---|
| 21 | a value of \-1 is returned and
|
---|
| 22 | .B errno
|
---|
| 23 | is set to indicate the error.
|
---|
| 24 | .SH "ERRORS
|
---|
| 25 | .B Symlink
|
---|
| 26 | will fail and no link will be created if one or more of the following
|
---|
| 27 | are true:
|
---|
| 28 | .TP 15
|
---|
| 29 | [ENOTDIR]
|
---|
| 30 | A component of either path prefix is not a directory.
|
---|
| 31 | .TP 15
|
---|
| 32 | [ENAMETOOLONG]
|
---|
| 33 | A path name exceeds PATH_MAX characters.
|
---|
| 34 | .TP 15
|
---|
| 35 | [ENOENT]
|
---|
| 36 | A component of either path prefix does not exist.
|
---|
| 37 | .TP 15
|
---|
| 38 | [EACCES]
|
---|
| 39 | A component of either path prefix denies search permission.
|
---|
| 40 | .TP 15
|
---|
| 41 | [EACCES]
|
---|
| 42 | The requested link requires writing in a directory with a mode
|
---|
| 43 | that denies write permission.
|
---|
| 44 | .TP 15
|
---|
| 45 | [ELOOP]
|
---|
| 46 | Too many symbolic links were encountered in translating one of the pathnames.
|
---|
| 47 | .TP 15
|
---|
| 48 | [EEXIST]
|
---|
| 49 | The link named by \fIname2\fP exists.
|
---|
| 50 | .TP 15
|
---|
| 51 | [ENOSPC]
|
---|
| 52 | The directory in which the entry for the new link is being placed
|
---|
| 53 | cannot be extended because there is no space left on the file
|
---|
| 54 | system containing the directory.
|
---|
| 55 | .ig
|
---|
| 56 | .TP 15
|
---|
| 57 | [EDQUOT]
|
---|
| 58 | The directory in which the entry for the new link
|
---|
| 59 | is being placed cannot be extended because the
|
---|
| 60 | user's quota of disk blocks on the file system
|
---|
| 61 | containing the directory has been exhausted.
|
---|
| 62 | ..
|
---|
| 63 | .TP 15
|
---|
| 64 | [EIO]
|
---|
| 65 | An I/O error occurred while reading from or writing to
|
---|
| 66 | the file system to make the directory entry.
|
---|
| 67 | .TP 15
|
---|
| 68 | [EROFS]
|
---|
| 69 | The requested link requires writing in a directory on a read-only file
|
---|
| 70 | system.
|
---|
| 71 | .TP 15
|
---|
| 72 | [EFAULT]
|
---|
| 73 | One of the pathnames specified
|
---|
| 74 | is outside the process's allocated address space.
|
---|
| 75 | .SH "SEE ALSO"
|
---|
| 76 | .BR link (2),
|
---|
| 77 | .BR unlink (2).
|
---|