diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:43 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:43 -0400 |
| commit | ac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (patch) | |
| tree | 9367490586c84cba28652e443e3166d66c33b0d9 /static/freebsd/man9/selrecord.9 4.html | |
| parent | 253e67c8b3a72b3a4757fdbc5845297628db0a4a (diff) | |
docs: Added All FreeBSD Manuals
Diffstat (limited to 'static/freebsd/man9/selrecord.9 4.html')
| -rw-r--r-- | static/freebsd/man9/selrecord.9 4.html | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/static/freebsd/man9/selrecord.9 4.html b/static/freebsd/man9/selrecord.9 4.html new file mode 100644 index 00000000..9a70d9b4 --- /dev/null +++ b/static/freebsd/man9/selrecord.9 4.html @@ -0,0 +1,94 @@ +<table class="head"> + <tr> + <td class="head-ltitle">SELRECORD(9)</td> + <td class="head-vol">Kernel Developer's Manual</td> + <td class="head-rtitle">SELRECORD(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">seldrain</code>, + <code class="Nm">selrecord</code>, <code class="Nm">selwakeup</code> + — <span class="Nd">record and wakeup select requests</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/selinfo.h</a>></code></p> +<p class="Pp"><var class="Ft">void</var> + <br/> + <code class="Fn">seldrain</code>(<var class="Fa" style="white-space: nowrap;">struct + selinfo *sip</var>);</p> +<p class="Pp"><var class="Ft">void</var> + <br/> + <code class="Fn">selrecord</code>(<var class="Fa" style="white-space: nowrap;">struct + thread *td</var>, <var class="Fa" style="white-space: nowrap;">struct + selinfo *sip</var>);</p> +<p class="Pp"><var class="Ft">void</var> + <br/> + <code class="Fn">selwakeup</code>(<var class="Fa" style="white-space: nowrap;">struct + selinfo *sip</var>);</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> +<p class="Pp"><a class="permalink" href="#seldrain"><code class="Fn" id="seldrain">seldrain</code></a>(), + <code class="Fn">selrecord</code>() and <code class="Fn">selwakeup</code>() + are the three central functions used by <a class="Xr">select(2)</a>, + <a class="Xr">poll(2)</a> and the objects that are being selected on. They + handle the task of recording which threads are waiting on which objects and + the waking of the proper threads when an event of interest occurs on an + object.</p> +<p class="Pp" id="selrecord"><a class="permalink" href="#selrecord"><code class="Fn">selrecord</code></a>() + records that the calling thread is interested in events related to a given + object. If another thread is already waiting on the object a collision will + be flagged in <var class="Fa">sip</var> which will be later dealt with by + <code class="Fn">selwakeup</code>().</p> +<p class="Pp" id="selrecord~2"><a class="permalink" href="#selrecord~2"><code class="Fn">selrecord</code></a>() + acquires and releases <var class="Va">sellock</var>.</p> +<p class="Pp" id="selwakeup"><a class="permalink" href="#selwakeup"><code class="Fn">selwakeup</code></a>() + is called by the underlying object handling code in order to notify any + waiting threads that an event of interest has occurred. If a collision has + occurred, <code class="Fn">selwakeup</code>() will increment + <var class="Va">nselcoll</var>, and broadcast on the global cv in order to + wake all waiting threads so that they can handle it. If the thread waiting + on the object is not currently sleeping or the wait channel is not + <var class="Va">selwait</var>, <code class="Fn">selwakeup</code>() will + clear the <code class="Dv">TDF_SELECT</code> flag which should be noted by + <a class="Xr">select(2)</a> and <a class="Xr">poll(2)</a> when they wake + up.</p> +<p class="Pp" id="seldrain~2"><a class="permalink" href="#seldrain~2"><code class="Fn">seldrain</code></a>() + will flush the waiters queue on a specified object before its destruction. + The object handling code must ensure that <var class="Fa">*sip</var> cannot + be used once <code class="Fn">seldrain</code>() has been called.</p> +<p class="Pp" id="selrecord~3">The contents of <var class="Fa">*sip</var> must + be zeroed, such as by softc initialization, before any call to + <a class="permalink" href="#selrecord~3"><code class="Fn">selrecord</code></a>() + or <code class="Fn">selwakeup</code>(), otherwise a panic may occur. + <code class="Fn">selwakeup</code>() acquires and releases + <var class="Va">sellock</var> and may acquire and release + <var class="Va">sched_lock</var>. <code class="Fn">seldrain</code>() could + usually be just a wrapper for <code class="Fn">selwakeup</code>(), but + consumers should not generally rely on this feature.</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">poll(2)</a>, <a class="Xr">select(2)</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 written by <span class="An">Chad David</span> + <<a class="Mt" href="mailto:davidc@FreeBSD.org">davidc@FreeBSD.org</a>> + and <span class="An">Alfred Perlstein</span> + <<a class="Mt" href="mailto:alfred@FreeBSD.org">alfred@FreeBSD.org</a>>.</p> +</section> +</div> +<table class="foot"> + <tr> + <td class="foot-date">August 25, 2011</td> + <td class="foot-os">FreeBSD 15.0</td> + </tr> +</table> |
