1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)link.2 6.3 (Berkeley) 8/26/85
7 .TH LINK 2 "August 26, 1985"
10 link \- make a hard link to a file
16 int link(const char *\fIname1\fP, const char *\fIname2\fP)
34 must be in the same file system.
36 must not be a directory.
37 Both the old and the new
39 share equal access and rights to
40 the underlying object.
42 Upon successful completion, a value of 0 is returned. Otherwise,
43 a value of \-1 is returned and
45 is set to indicate the error.
48 will fail and no link will be created if one or more of the following
52 A component of either path prefix is not a directory.
55 A path name exceeds PATH_MAX characters.
58 A component of either path prefix does not exist.
61 A component of either path prefix denies search permission.
64 The requested link requires writing in a directory with a mode
65 that denies write permission.
68 Too many symbolic links were encountered in translating one of the pathnames.
72 The file named by \fIname1\fP does not exist.
75 The link named by \fIname2\fP does exist.
78 The file named by \fIname1\fP is a directory and the effective
79 user ID is not super-user.
82 The link named by \fIname2\fP and the file named by \fIname1\fP
83 are on different file systems.
86 The directory in which the entry for the new link is being placed
87 cannot be extended because there is no space left on the file
88 system containing the directory.
92 The directory in which the entry for the new link
93 is being placed cannot be extended because the
94 user's quota of disk blocks on the file system
95 containing the directory has been exhausted.
99 An I/O error occurred while reading from or writing to
100 the file system to make the directory entry.
103 The requested link requires writing in a directory on a read-only file
107 One of the pathnames specified
108 is outside the process's allocated address space.