source: trunk/minix/man/man2/link.2@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 2.5 KB
Line 
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.
4.\"
5.\" @(#)link.2 6.3 (Berkeley) 8/26/85
6.\"
7.TH LINK 2 "August 26, 1985"
8.UC 4
9.SH NAME
10link \- make a hard link to a file
11.SH SYNOPSIS
12.nf
13.ft B
14#include <unistd.h>
15
16int link(const char *\fIname1\fP, const char *\fIname2\fP)
17.fi
18.ft R
19.SH DESCRIPTION
20A hard link
21to
22.I name1
23is created;
24the link has the name
25.IR name2 .
26.I Name1
27must exist.
28.PP
29With hard links,
30both
31.I name1
32and
33.I name2
34must be in the same file system.
35.I Name1
36must not be a directory.
37Both the old and the new
38.I link
39share equal access and rights to
40the underlying object.
41.SH "RETURN VALUE
42Upon successful completion, a value of 0 is returned. Otherwise,
43a value of \-1 is returned and
44.B errno
45is set to indicate the error.
46.SH "ERRORS
47.B Link
48will fail and no link will be created if one or more of the following
49are true:
50.TP 15
51[ENOTDIR]
52A component of either path prefix is not a directory.
53.TP 15
54[ENAMETOOLONG]
55A path name exceeds PATH_MAX characters.
56.TP 15
57[ENOENT]
58A component of either path prefix does not exist.
59.TP 15
60[EACCES]
61A component of either path prefix denies search permission.
62.TP 15
63[EACCES]
64The requested link requires writing in a directory with a mode
65that denies write permission.
66.TP 15
67[ELOOP]
68Too many symbolic links were encountered in translating one of the pathnames.
69(Minix-vmd)
70.TP 15
71[ENOENT]
72The file named by \fIname1\fP does not exist.
73.TP 15
74[EEXIST]
75The link named by \fIname2\fP does exist.
76.TP 15
77[EPERM]
78The file named by \fIname1\fP is a directory and the effective
79user ID is not super-user.
80.TP 15
81[EXDEV]
82The link named by \fIname2\fP and the file named by \fIname1\fP
83are on different file systems.
84.TP 15
85[ENOSPC]
86The directory in which the entry for the new link is being placed
87cannot be extended because there is no space left on the file
88system containing the directory.
89.ig
90.TP 15
91[EDQUOT]
92The directory in which the entry for the new link
93is being placed cannot be extended because the
94user's quota of disk blocks on the file system
95containing the directory has been exhausted.
96..
97.TP 15
98[EIO]
99An I/O error occurred while reading from or writing to
100the file system to make the directory entry.
101.TP 15
102[EROFS]
103The requested link requires writing in a directory on a read-only file
104system.
105.TP 15
106[EFAULT]
107One of the pathnames specified
108is outside the process's allocated address space.
109.SH "SEE ALSO"
110.BR symlink (2),
111.BR unlink (2).
Note: See TracBrowser for help on using the repository browser.