summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/dev_clone.9 4.html
blob: f978b0e0f5f45ca80181f5e65cf504897fdcce6e (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
<table class="head">
  <tr>
    <td class="head-ltitle">DEV_CLONE(9)</td>
    <td class="head-vol">Kernel Developer's Manual</td>
    <td class="head-rtitle">DEV_CLONE(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">dev_clone</code>,
    <code class="Nm">drain_dev_clone_events</code> &#x2014;
    <span class="Nd">eventhandler for name-based device cloning in
  devfs</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
    &lt;<a class="In">sys/param.h</a>&gt;</code>
  <br/>
  <code class="In">#include &lt;<a class="In">sys/conf.h</a>&gt;</code></p>
<p class="Pp"><var class="Ft">void</var>
  <br/>
  <code class="Fn">clone_handler</code>(<var class="Fa" style="white-space: nowrap;">void
    *arg</var>, <var class="Fa" style="white-space: nowrap;">struct ucred
    *cr</var>, <var class="Fa" style="white-space: nowrap;">char *name</var>,
    <var class="Fa" style="white-space: nowrap;">int namelen</var>,
    <var class="Fa" style="white-space: nowrap;">struct cdev **dev</var>);</p>
<div class="Bd Pp Li">
<pre>EVENTHANDLER_REGISTER(dev_clone, clone_handler, arg, priority);</pre>
</div>
<br/>
<var class="Ft">void</var>
<br/>
<code class="Fn">drain_dev_clone_events</code>();
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">A device driver may register a listener that will be notified each
    time a name lookup on the <a class="Xr">devfs(4)</a> mount point fails to
    find the vnode. A listener shall be registered for the
    <var class="Va">dev_clone</var> event. When called, it is supplied with the
    first argument <var class="Va">arg</var> that was specified at handler
    registration time, appropriate credentials <var class="Va">cr</var>, and a
    name <var class="Va">name</var> of length <var class="Va">namelen</var> that
    we look for. If the handler decides that the name is appropriate and wants
    to create the device that will be associated with the name, it should return
    it to devfs in the <var class="Va">dev</var> argument.</p>
<p class="Pp" id="drain_dev_clone_events">The
    <a class="permalink" href="#drain_dev_clone_events"><code class="Fn">drain_dev_clone_events</code></a>()
    function is a barrier. It is guaranteed that all calls to eventhandlers for
    <code class="Nm">dev_clone</code> that were started before
    <code class="Fn">drain_dev_clone_events</code>() call, are finished before
    it returns control.</p>
</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">devfs(4)</a>, <a class="Xr">namei(9)</a></p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 3, 2009</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>