don't use hash mark for comments
[unix-history] / usr / src / lib / libc / sys / symlink.2
CommitLineData
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
21symlink \- make symbolic link to a file
22.SH SYNOPSIS
23.nf
24.ft B
25symlink(name1, name2)
26char *name1, *name2;
27.fi
28.ft R
29.SH DESCRIPTION
30A symbolic link
31.I name2
32is created to
33.IR name1
34(\fIname2\fP is the name of the
35file created, \fIname1\fP is the string
36used in creating the symbolic link).
37Either name may be an arbitrary path name; the files need not
38be on the same file system.
39.SH "RETURN VALUE
40Upon successful completion, a zero value is returned.
41If an error occurs, the error code is stored in \fIerrno\fP
42and a \-1 value is returned.
43.SH "ERRORS
44The symbolic link is made unless on or more of the
45following are true:
46.TP 15
b5984ffe
KM
47[ENOTDIR]
48A component of the \fIname2\fP prefix is not a directory.
49.TP 15
50[EINVAL]
51Either \fIname1\fP or \fIname2\fP
1ea523c5
KM
52contains a character with the high-order bit set.
53.TP 15
b5984ffe
KM
54[ENAMETOOLONG]
55A component of either pathname exceeded 255 characters,
56or the entire length of either path name exceeded 1023 characters.
57.TP 15
1ea523c5 58[ENOENT]
b5984ffe 59The named file does not exist.
1ea523c5 60.TP 15
b5984ffe
KM
61[EACCES]
62A component of the \fIname2\fP path prefix denies search permission.
63.TP 15
64[ELOOP]
65Too 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]
71An I/O error occurred while making the directory entry for \fIname2\fP,
72or allocating the inode for \fIname2\fP,
73or writing out the link contents of \fIname2\fP.
1ea523c5
KM
74.TP 15
75[EROFS]
76The file \fIname2\fP would reside on a read-only file system.
77.TP 15
fd690c8b
KM
78[ENOSPC]
79The directory in which the entry for the new symbolic link is being placed
80cannot be extended because there is no space left on the file
81system containing the directory.
82.TP 15
83[ENOSPC]
84The new symbolic link cannot be created because there
85there is no space left on the file
86system that will contain the symbolic link.
87.TP 15
88[ENOSPC]
89There are no free inodes on the file system on which the
90symbolic link is being created.
91.TP 15
92[EDQUOT]
93The directory in which the entry for the new symbolic link
94is being placed cannot be extended because the
95user's quota of disk blocks on the file system
96containing the directory has been exhausted.
97.TP 15
98[EDQUOT]
99The new symbolic link cannot be created because the user's
100quota of disk blocks on the file system that will
101contain the symbolic link has been exhausted.
102.TP 15
103[EDQUOT]
104The user's quota of inodes on the file system on
105which the symbolic link is being created has been exhausted.
106.TP 15
107[EIO]
108An I/O error occurred while making the directory entry or allocating the inode.
109.TP 15
1ea523c5
KM
110[EFAULT]
111.I Name1
112or
113.I name2
114points outside the process's allocated address space.
1ea523c5
KM
115.SH "SEE ALSO"
116link(2), ln(1), unlink(2)