1SYMLINK(2) System Calls Manual SYMLINK(2)
2
3
4
6 symlink - make symbolic link to a file
7
9 symlink(name1, name2)
10 char *name1, *name2;
11
13 A symbolic link name2 is created to name1 (name2 is the name of the
14 file created, name1 is the string used in creating the symbolic link).
15 Either name may be an arbitrary path name; the files need not be on the
16 same file system.
17
19 Upon successful completion, a zero value is returned. If an error
20 occurs, the error code is stored in errno and a -1 value is returned.
21
23 The symbolic link is made unless on or more of the following are true:
24
25 [ENOTDIR] A component of the name2 prefix is not a directory.
26
27 [EINVAL] Either name1 or name2 contains a character with the
28 high-order bit set.
29
30 [ENAMETOOLONG] A component of either pathname exceeded 255 characters,
31 or the entire length of either path name exceeded 1023
32 characters.
33
34 [ENOENT] The named file does not exist.
35
36 [EACCES] A component of the name2 path prefix denies search per‐
37 mission.
38
39 [ELOOP] Too many symbolic links were encountered in translating
40 the pathname.
41
42 [EEXIST] Name2 already exists.
43
44 [EIO] An I/O error occurred while making the directory entry
45 for name2, or allocating the inode for name2, or writing
46 out the link contents of name2.
47
48 [EROFS] The file name2 would reside on a read-only file system.
49
50 [ENOSPC] The directory in which the entry for the new symbolic
51 link is being placed cannot be extended because there is
52 no space left on the file system containing the direc‐
53 tory.
54
55 [ENOSPC] The new symbolic link cannot be created because there
56 there is no space left on the file system that will con‐
57 tain the symbolic link.
58
59 [ENOSPC] There are no free inodes on the file system on which the
60 symbolic link is being created.
61
62 [EDQUOT] The directory in which the entry for the new symbolic
63 link is being placed cannot be extended because the
64 user's quota of disk blocks on the file system contain‐
65 ing the directory has been exhausted.
66
67 [EDQUOT] The new symbolic link cannot be created because the
68 user's quota of disk blocks on the file system that will
69 contain the symbolic link has been exhausted.
70
71 [EDQUOT] The user's quota of inodes on the file system on which
72 the symbolic link is being created has been exhausted.
73
74 [EIO] An I/O error occurred while making the directory entry
75 or allocating the inode.
76
77 [EFAULT] Name1 or name2 points outside the process's allocated
78 address space.
79
81 link(2), ln(1), unlink(2)
82
83
84
854.2 Berkeley Distribution August 26, 1985 SYMLINK(2)