blob: ed5ee46b293a2b19dc86370671c5f3be771c8078 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
<table class="head">
<tr>
<td class="head-ltitle">VOP_LINK(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">VOP_LINK(9)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">VOP_LINK</code> — <span class="Nd">create
a new name for a file</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
<<a class="In">sys/param.h</a>></code>
<br/>
<code class="In">#include <<a class="In">sys/vnode.h</a>></code></p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">VOP_LINK</code>(<var class="Fa" style="white-space: nowrap;">struct
vnode *dvp</var>, <var class="Fa" style="white-space: nowrap;">struct vnode
*vp</var>, <var class="Fa" style="white-space: nowrap;">struct componentname
*cnp</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">This links a new name in the specified directory to an existing
file.</p>
<p class="Pp">Its arguments are:</p>
<dl class="Bl-tag">
<dt><var class="Fa">dvp</var></dt>
<dd>The vnode of the directory.</dd>
<dt><var class="Fa">vp</var></dt>
<dd>The vnode of the file to be linked.</dd>
<dt><var class="Fa">cnp</var></dt>
<dd>Pathname information about the file.</dd>
</dl>
<p class="Pp">The pathname info should <i class="Em">not</i> be released on exit
because it is done by the caller. The directory and file vnodes should
<i class="Em">not</i> be released on exit.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="LOCKS"><a class="permalink" href="#LOCKS">LOCKS</a></h1>
<p class="Pp"><a class="permalink" href="#VOP_LINK"><code class="Fn" id="VOP_LINK">VOP_LINK</code></a>()
expects the directory and file vnodes to be locked on entry and will leave
the vnodes locked on return.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
VALUES</a></h1>
<p class="Pp">Zero is returned if the file was linked successfully, otherwise an
error is returned.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<dl class="Bl-tag">
<dt id="EMLINK">[<a class="permalink" href="#EMLINK"><code class="Er">EMLINK</code></a>]</dt>
<dd>The file has too many links.</dd>
<dt id="EPERM">[<a class="permalink" href="#EPERM"><code class="Er">EPERM</code></a>]</dt>
<dd>The file is immutable.</dd>
<dt id="EXDEV">[<a class="permalink" href="#EXDEV"><code class="Er">EXDEV</code></a>]</dt>
<dd>A hard link is not possible between different file systems.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">vn_lock(9)</a>, <a class="Xr">vnode(9)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page was originally written by <span class="An">Doug
Rabson</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">July 24, 1996</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|