Commit | Line | Data |
---|---|---|
15715acc KB |
1 | .\" Copyright (c) 1983, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
1ea523c5 | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
88b3ccf2 | 5 | .\" |
15715acc | 6 | .\" @(#)symlink.2 8.1 (Berkeley) %G% |
1ea523c5 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt SYMLINK 2 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm symlink | |
13 | .Nd make symbolic link to a file | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft int | |
17 | .Fn symlink "const char *name1" "const char *name2" | |
18 | .Sh DESCRIPTION | |
1ea523c5 | 19 | A symbolic link |
931b8415 | 20 | .Fa name2 |
1ea523c5 | 21 | is created to |
931b8415 CL |
22 | .Fa name1 |
23 | .Pf ( Fa name2 | |
24 | is the name of the | |
25 | file created, | |
26 | .Fa name1 | |
27 | is the string | |
1ea523c5 KM |
28 | used in creating the symbolic link). |
29 | Either name may be an arbitrary path name; the files need not | |
30 | be on the same file system. | |
931b8415 | 31 | .Sh RETURN VALUES |
1ea523c5 | 32 | Upon successful completion, a zero value is returned. |
931b8415 CL |
33 | If an error occurs, the error code is stored in |
34 | .Va errno | |
35 | and a -1 value is returned. | |
36 | .Sh ERRORS | |
37 | The symbolic link succeeds unless: | |
38 | .Bl -tag -width ENAMETOO | |
39 | .It Bq Er ENOTDIR | |
40 | A component of the | |
41 | .Fa name2 | |
42 | prefix is not a directory. | |
43 | .It Bq Er EINVAL | |
44 | Either | |
45 | .Fa name1 | |
46 | or | |
47 | .Fa name2 | |
1ea523c5 | 48 | contains a character with the high-order bit set. |
931b8415 | 49 | .It Bq Er ENAMETOOLONG |
b5984ffe KM |
50 | A component of either pathname exceeded 255 characters, |
51 | or the entire length of either path name exceeded 1023 characters. | |
931b8415 | 52 | .It Bq Er ENOENT |
b5984ffe | 53 | The named file does not exist. |
931b8415 CL |
54 | .It Bq Er EACCES |
55 | A component of the | |
56 | .Fa name2 | |
57 | path prefix denies search permission. | |
58 | .It Bq Er ELOOP | |
b5984ffe | 59 | Too many symbolic links were encountered in translating the pathname. |
931b8415 CL |
60 | .It Bq Er EEXIST |
61 | .Fa Name2 | |
62 | already exists. | |
63 | .It Bq Er EIO | |
64 | An I/O error occurred while making the directory entry for | |
65 | .Fa name2 , | |
66 | or allocating the inode for | |
67 | .Fa name2 , | |
68 | or writing out the link contents of | |
69 | .Fa name2 . | |
70 | .It Bq Er EROFS | |
71 | The file | |
72 | .Fa name2 | |
73 | would reside on a read-only file system. | |
74 | .It Bq Er ENOSPC | |
fd690c8b KM |
75 | The directory in which the entry for the new symbolic link is being placed |
76 | cannot be extended because there is no space left on the file | |
77 | system containing the directory. | |
931b8415 | 78 | .It Bq Er ENOSPC |
fd690c8b KM |
79 | The new symbolic link cannot be created because there |
80 | there is no space left on the file | |
81 | system that will contain the symbolic link. | |
931b8415 | 82 | .It Bq Er ENOSPC |
fd690c8b KM |
83 | There are no free inodes on the file system on which the |
84 | symbolic link is being created. | |
931b8415 | 85 | .It Bq Er EDQUOT |
fd690c8b KM |
86 | The directory in which the entry for the new symbolic link |
87 | is being placed cannot be extended because the | |
88 | user's quota of disk blocks on the file system | |
89 | containing the directory has been exhausted. | |
931b8415 | 90 | .It Bq Er EDQUOT |
fd690c8b KM |
91 | The new symbolic link cannot be created because the user's |
92 | quota of disk blocks on the file system that will | |
93 | contain the symbolic link has been exhausted. | |
931b8415 | 94 | .It Bq Er EDQUOT |
fd690c8b KM |
95 | The user's quota of inodes on the file system on |
96 | which the symbolic link is being created has been exhausted. | |
931b8415 | 97 | .It Bq Er EIO |
fd690c8b | 98 | An I/O error occurred while making the directory entry or allocating the inode. |
931b8415 CL |
99 | .It Bq Er EFAULT |
100 | .Fa Name1 | |
1ea523c5 | 101 | or |
931b8415 | 102 | .Fa name2 |
1ea523c5 | 103 | points outside the process's allocated address space. |
931b8415 CL |
104 | .El |
105 | .Sh SEE ALSO | |
106 | .Xr link 2 , | |
107 | .Xr ln 1 , | |
108 | .Xr unlink 2 | |
109 | .Sh HISTORY | |
110 | The | |
111 | .Nm | |
112 | function call appeared in | |
113 | .Bx 4.2 . |