]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - lib/libc/sys/symlink.2
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / lib / libc / sys / symlink.2
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)symlink.2   8.1 (Berkeley) 6/4/93
29 .\" $FreeBSD$
30 .\"
31 .Dd December 9, 2006
32 .Dt SYMLINK 2
33 .Os
34 .Sh NAME
35 .Nm symlink
36 .Nd make symbolic link to a file
37 .Sh LIBRARY
38 .Lb libc
39 .Sh SYNOPSIS
40 .In unistd.h
41 .Ft int
42 .Fn symlink "const char *name1" "const char *name2"
43 .Sh DESCRIPTION
44 A symbolic link
45 .Fa name2
46 is created to
47 .Fa name1
48 .Fa ( name2
49 is the name of the
50 file created,
51 .Fa name1
52 is the string
53 used in creating the symbolic link).
54 Either name may be an arbitrary path name; the files need not
55 be on the same file system.
56 .Sh RETURN VALUES
57 .Rv -std symlink
58 .Sh ERRORS
59 The symbolic link succeeds unless:
60 .Bl -tag -width Er
61 .It Bq Er ENOTDIR
62 A component of the
63 .Fa name2
64 path prefix is not a directory.
65 .It Bq Er ENAMETOOLONG
66 A component of the
67 .Fa name2
68 pathname exceeded 255 characters,
69 or the entire length of either path name exceeded 1023 characters.
70 .It Bq Er ENOENT
71 A component of the
72 .Fa name2
73 path prefix does not exist.
74 .It Bq Er EACCES
75 A component of the
76 .Fa name2
77 path prefix denies search permission, or write permission is denied on the
78 parent directory of the file to be created.
79 .It Bq Er ELOOP
80 Too many symbolic links were encountered in translating the
81 .Fa name2
82 path name.
83 .It Bq Er EEXIST
84 The path name pointed at by the
85 .Fa name2
86 argument
87 already exists.
88 .It Bq Er EPERM
89 The parent directory of the file named by
90 .Fa name2
91 has its immutable flag set, see the
92 .Xr chflags 2
93 manual page for more information.
94 .It Bq Er EIO
95 An I/O error occurred while making the directory entry for
96 .Fa name2 ,
97 or allocating the inode for
98 .Fa name2 ,
99 or writing out the link contents of
100 .Fa name2 .
101 .It Bq Er EROFS
102 The file
103 .Fa name2
104 would reside on a read-only file system.
105 .It Bq Er ENOSPC
106 The directory in which the entry for the new symbolic link is being placed
107 cannot be extended because there is no space left on the file
108 system containing the directory.
109 .It Bq Er ENOSPC
110 The new symbolic link cannot be created because
111 there is no space left on the file
112 system that will contain the symbolic link.
113 .It Bq Er ENOSPC
114 There are no free inodes on the file system on which the
115 symbolic link is being created.
116 .It Bq Er EDQUOT
117 The directory in which the entry for the new symbolic link
118 is being placed cannot be extended because the
119 user's quota of disk blocks on the file system
120 containing the directory has been exhausted.
121 .It Bq Er EDQUOT
122 The new symbolic link cannot be created because the user's
123 quota of disk blocks on the file system that will
124 contain the symbolic link has been exhausted.
125 .It Bq Er EDQUOT
126 The user's quota of inodes on the file system on
127 which the symbolic link is being created has been exhausted.
128 .It Bq Er EIO
129 An I/O error occurred while making the directory entry or allocating the inode.
130 .It Bq Er EFAULT
131 The
132 .Fa name1
133 or
134 .Fa name2
135 argument
136 points outside the process's allocated address space.
137 .El
138 .Sh SEE ALSO
139 .Xr ln 1 ,
140 .Xr chflags 2 ,
141 .Xr link 2 ,
142 .Xr lstat 2 ,
143 .Xr readlink 2 ,
144 .Xr unlink 2 ,
145 .Xr symlink 7
146 .Sh HISTORY
147 The
148 .Fn symlink
149 system call appeared in
150 .Bx 4.2 .