Commit | Line | Data |
---|---|---|
88b3ccf2 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
1ea523c5 | 3 | .\" |
88b3ccf2 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)symlink.2 6.4 (Berkeley) %G% | |
1ea523c5 | 17 | .\" |
8f623f8e | 18 | .TH SYMLINK 2 "" |
1ea523c5 KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | symlink \- make symbolic link to a file | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .ft B | |
25 | symlink(name1, name2) | |
26 | char *name1, *name2; | |
27 | .fi | |
28 | .ft R | |
29 | .SH DESCRIPTION | |
30 | A symbolic link | |
31 | .I name2 | |
32 | is created to | |
33 | .IR name1 | |
34 | (\fIname2\fP is the name of the | |
35 | file created, \fIname1\fP is the string | |
36 | used in creating the symbolic link). | |
37 | Either name may be an arbitrary path name; the files need not | |
38 | be on the same file system. | |
39 | .SH "RETURN VALUE | |
40 | Upon successful completion, a zero value is returned. | |
41 | If an error occurs, the error code is stored in \fIerrno\fP | |
42 | and a \-1 value is returned. | |
43 | .SH "ERRORS | |
44 | The symbolic link is made unless on or more of the | |
45 | following are true: | |
46 | .TP 15 | |
b5984ffe KM |
47 | [ENOTDIR] |
48 | A component of the \fIname2\fP prefix is not a directory. | |
49 | .TP 15 | |
50 | [EINVAL] | |
51 | Either \fIname1\fP or \fIname2\fP | |
1ea523c5 KM |
52 | contains a character with the high-order bit set. |
53 | .TP 15 | |
b5984ffe KM |
54 | [ENAMETOOLONG] |
55 | A component of either pathname exceeded 255 characters, | |
56 | or the entire length of either path name exceeded 1023 characters. | |
57 | .TP 15 | |
1ea523c5 | 58 | [ENOENT] |
b5984ffe | 59 | The named file does not exist. |
1ea523c5 | 60 | .TP 15 |
b5984ffe KM |
61 | [EACCES] |
62 | A component of the \fIname2\fP path prefix denies search permission. | |
63 | .TP 15 | |
64 | [ELOOP] | |
65 | Too many symbolic links were encountered in translating the pathname. | |
1ea523c5 KM |
66 | .TP 15 |
67 | [EEXIST] | |
68 | \fIName2\fP already exists. | |
69 | .TP 15 | |
b5984ffe KM |
70 | [EIO] |
71 | An I/O error occurred while making the directory entry for \fIname2\fP, | |
72 | or allocating the inode for \fIname2\fP, | |
73 | or writing out the link contents of \fIname2\fP. | |
1ea523c5 KM |
74 | .TP 15 |
75 | [EROFS] | |
76 | The file \fIname2\fP would reside on a read-only file system. | |
77 | .TP 15 | |
fd690c8b KM |
78 | [ENOSPC] |
79 | The directory in which the entry for the new symbolic link is being placed | |
80 | cannot be extended because there is no space left on the file | |
81 | system containing the directory. | |
82 | .TP 15 | |
83 | [ENOSPC] | |
84 | The new symbolic link cannot be created because there | |
85 | there is no space left on the file | |
86 | system that will contain the symbolic link. | |
87 | .TP 15 | |
88 | [ENOSPC] | |
89 | There are no free inodes on the file system on which the | |
90 | symbolic link is being created. | |
91 | .TP 15 | |
92 | [EDQUOT] | |
93 | The directory in which the entry for the new symbolic link | |
94 | is being placed cannot be extended because the | |
95 | user's quota of disk blocks on the file system | |
96 | containing the directory has been exhausted. | |
97 | .TP 15 | |
98 | [EDQUOT] | |
99 | The new symbolic link cannot be created because the user's | |
100 | quota of disk blocks on the file system that will | |
101 | contain the symbolic link has been exhausted. | |
102 | .TP 15 | |
103 | [EDQUOT] | |
104 | The user's quota of inodes on the file system on | |
105 | which the symbolic link is being created has been exhausted. | |
106 | .TP 15 | |
107 | [EIO] | |
108 | An I/O error occurred while making the directory entry or allocating the inode. | |
109 | .TP 15 | |
1ea523c5 KM |
110 | [EFAULT] |
111 | .I Name1 | |
112 | or | |
113 | .I name2 | |
114 | points outside the process's allocated address space. | |
1ea523c5 KM |
115 | .SH "SEE ALSO" |
116 | link(2), ln(1), unlink(2) |