summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/devfs_set_cdevpriv.9 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man9/devfs_set_cdevpriv.9 3.html')
-rw-r--r--static/freebsd/man9/devfs_set_cdevpriv.9 3.html127
1 files changed, 0 insertions, 127 deletions
diff --git a/static/freebsd/man9/devfs_set_cdevpriv.9 3.html b/static/freebsd/man9/devfs_set_cdevpriv.9 3.html
deleted file mode 100644
index 46f226bb..00000000
--- a/static/freebsd/man9/devfs_set_cdevpriv.9 3.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<table class="head">
- <tr>
- <td class="head-ltitle">DEVFS_CDEVPRIV(9)</td>
- <td class="head-vol">Kernel Developer's Manual</td>
- <td class="head-rtitle">DEVFS_CDEVPRIV(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">devfs_set_cdevpriv</code>,
- <code class="Nm">devfs_get_cdevpriv</code>,
- <code class="Nm">devfs_clear_cdevpriv</code>,
- <code class="Nm">devfs_foreach_cdevpriv</code> &#x2014;
- <span class="Nd">manage per-open filedescriptor data for devices</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>
-<div class="Bd Pp Li">
-<pre>typedef void d_priv_dtor_t(void *data);</pre>
-</div>
-<br/>
-<var class="Ft">int</var>
-<br/>
-<code class="Fn">devfs_get_cdevpriv</code>(<var class="Fa" style="white-space: nowrap;">void
- **datap</var>);
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">devfs_set_cdevpriv</code>(<var class="Fa" style="white-space: nowrap;">void
- *priv</var>, <var class="Fa" style="white-space: nowrap;">d_priv_dtor_t
- *dtr</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">devfs_clear_cdevpriv</code>(<var class="Fa" style="white-space: nowrap;">void</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">devfs_foreach_cdevpriv</code>(<var class="Fa">struct cdev
- *dev</var>, <var class="Fa">int (*cb)(void *data, void *arg)</var>,
- <var class="Fa">void *arg</var>);</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
-<p class="Pp">The
- <a class="permalink" href="#devfs_xxx_cdevpriv"><code class="Fn" id="devfs_xxx_cdevpriv">devfs_xxx_cdevpriv</code></a>()
- family of functions allows the <var class="Fa">cdev</var> driver methods to
- associate some driver-specific data with each user process
- <a class="Xr">open(2)</a> of the device special file. Currently, functioning
- of these functions is restricted to the context of the
- <var class="Fa">cdevsw</var> switch method calls performed as
- <a class="Xr">devfs(4)</a> operations in response to system calls that use
- filedescriptors.</p>
-<p class="Pp" id="devfs_set_cdevpriv">The
- <a class="permalink" href="#devfs_set_cdevpriv"><code class="Fn">devfs_set_cdevpriv</code></a>()
- function associates a data pointed by <var class="Va">priv</var> with
- current calling context (filedescriptor). The data may be retrieved later,
- possibly from another call performed on this filedescriptor, by the
- <code class="Fn">devfs_get_cdevpriv</code>() function. The
- <code class="Fn">devfs_clear_cdevpriv</code>() disassociates previously
- attached data from context. Immediately after
- <code class="Fn">devfs_clear_cdevpriv</code>() finished operating, the
- <var class="Va">dtr</var> callback is called, with private data supplied
- <var class="Va">data</var> argument. The
- <code class="Fn">devfs_clear_cdevpriv</code>() function will be also be
- called if the open callback function returns an error code.</p>
-<p class="Pp" id="devfs_clear_cdevpriv">On the last filedescriptor close, system
- automatically arranges
- <a class="permalink" href="#devfs_clear_cdevpriv"><code class="Fn">devfs_clear_cdevpriv</code></a>()
- call.</p>
-<p class="Pp">If successful, the functions return 0.</p>
-<p class="Pp" id="devfs_set_cdevpriv~2">The function
- <a class="permalink" href="#devfs_set_cdevpriv~2"><code class="Fn">devfs_set_cdevpriv</code></a>()
- returns the following values on error:</p>
-<dl class="Bl-tag">
- <dt>[<code class="Er">ENOENT</code>]</dt>
- <dd>The current call is not associated with some filedescriptor.</dd>
- <dt>[<code class="Er">EBUSY</code>]</dt>
- <dd>The private driver data is already associated with current
- filedescriptor.</dd>
-</dl>
-<p class="Pp" id="devfs_get_cdevpriv">The function
- <a class="permalink" href="#devfs_get_cdevpriv"><code class="Fn">devfs_get_cdevpriv</code></a>()
- returns the following values on error:</p>
-<dl class="Bl-tag">
- <dt>[<code class="Er">EBADF</code>]</dt>
- <dd>The current call is not associated with some filedescriptor.</dd>
- <dt>[<code class="Er">ENOENT</code>]</dt>
- <dd>The private driver data was not associated with current filedescriptor, or
- <code class="Fn">devfs_clear_cdevpriv</code>() was called.</dd>
-</dl>
-<p class="Pp" id="devfs_foreach_cdevpriv">The function
- <a class="permalink" href="#devfs_foreach_cdevpriv"><code class="Fn">devfs_foreach_cdevpriv</code></a>()
- sequentially calls the function <var class="Fa">cb</var> for each
- <code class="Nm">cdevpriv</code> structure, currently associated with the
- <var class="Fa">cdev</var> device. The iterated
- <code class="Nm">cdevpriv</code> data pointer and the user-supplied context
- <var class="Fa">arg</var> are passed to the function
- <var class="Fa">cb</var>. If <var class="Fa">cb</var> returns non-zero
- value, the iteration stops on that element. The
- <code class="Fn">devfs_foreach_cdevpriv</code>() returns the return value
- from the last call to <var class="Fa">cb</var>, or zero if no
- <code class="Nm">cdevpriv</code> data is currently associated with the
- device.</p>
-<p class="Pp">Current implementation of the iterator makes it impossible to use
- any blockable locking inside the callback <var class="Fa">cb</var>.</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">close(2)</a>, <a class="Xr">open(2)</a>,
- <a class="Xr">devfs(4)</a></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
-<p class="Pp">The <code class="Fn">devfs_cdevpriv</code>() family of functions
- first appeared in <span class="Ux">FreeBSD 7.1</span>.</p>
-</section>
-</div>
-<table class="foot">
- <tr>
- <td class="foot-date">March 23, 2024</td>
- <td class="foot-os">FreeBSD 15.0</td>
- </tr>
-</table>