summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/pthread_affinity_np.3 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man3/pthread_affinity_np.3 3.html')
-rw-r--r--static/freebsd/man3/pthread_affinity_np.3 3.html138
1 files changed, 138 insertions, 0 deletions
diff --git a/static/freebsd/man3/pthread_affinity_np.3 3.html b/static/freebsd/man3/pthread_affinity_np.3 3.html
new file mode 100644
index 00000000..c239533c
--- /dev/null
+++ b/static/freebsd/man3/pthread_affinity_np.3 3.html
@@ -0,0 +1,138 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">PTHREAD_AFFINITY_NP(3)</td>
+ <td class="head-vol">Library Functions Manual</td>
+ <td class="head-rtitle">PTHREAD_AFFINITY_NP(3)</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">pthread_getaffinity_np</code>,
+ <code class="Nm">pthread_setaffinity_np</code> &#x2014;
+ <span class="Nd">manage CPU affinity</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
+<p class="Pp"><span class="Lb">POSIX Threads Library (libpthread,
+ -lpthread)</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">pthread_np.h</a>&gt;</code></p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_getaffinity_np</code>(<var class="Fa" style="white-space: nowrap;">pthread_t
+ td</var>, <var class="Fa" style="white-space: nowrap;">size_t
+ cpusetsize</var>, <var class="Fa" style="white-space: nowrap;">cpuset_t
+ *cpusetp</var>);</p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_setaffinity_np</code>(<var class="Fa" style="white-space: nowrap;">pthread_t
+ td</var>, <var class="Fa" style="white-space: nowrap;">size_t
+ cpusetsize</var>, <var class="Fa" style="white-space: nowrap;">const
+ cpuset_t *cpusetp</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="#pthread_getaffinity_np"><code class="Fn" id="pthread_getaffinity_np">pthread_getaffinity_np</code></a>()
+ and <code class="Fn">pthread_setaffinity_np</code>() allow the manipulation
+ of sets of CPUs available to the specified thread.</p>
+<p class="Pp" id="pthread_getaffinity_np~2">Masks of type
+ <var class="Ft">cpuset_t</var> are composed using the
+ <code class="Dv">CPU_SET</code> macros. If the user-supplied mask is not
+ large enough to fit all of the matching CPUs,
+ <a class="permalink" href="#pthread_getaffinity_np~2"><code class="Fn">pthread_getaffinity_np</code></a>()
+ fails with <code class="Er">ERANGE</code>. Calls to
+ <code class="Fn">pthread_setaffinity_np</code>() tolerate masks of any size
+ with no restrictions. The kernel uses the meaningful part of the mask, where
+ the upper bound is the maximum CPU id present in the system. If bits for
+ non-existing CPUs are set, calls to
+ <code class="Fn">pthread_setaffinity_np</code>() fail with
+ <code class="Er">EINVAL</code>.</p>
+<p class="Pp">The supplied mask should have a size of
+ <var class="Fa">cpusetsize</var> bytes. This size is usually provided by
+ calling <code class="Li">sizeof(cpuset_t)</code> which is ultimately
+ determined by the value of <code class="Dv">CPU_SETSIZE</code> as defined in
+ <code class="In">&lt;<a class="In">sys/cpuset.h</a>&gt;</code>.</p>
+<p class="Pp" id="pthread_getaffinity_np~3"><a class="permalink" href="#pthread_getaffinity_np~3"><code class="Fn">pthread_getaffinity_np</code></a>()
+ retrieves the mask from the thread specified by <var class="Fa">td</var>,
+ and stores it in the space provided by <var class="Fa">cpusetp</var>.</p>
+<p class="Pp" id="pthread_setaffinity_np"><a class="permalink" href="#pthread_setaffinity_np"><code class="Fn">pthread_setaffinity_np</code></a>()
+ attempts to set the mask for the thread specified by
+ <var class="Fa">td</var> to the value in <var class="Fa">cpusetp</var>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
+ VALUES</a></h1>
+<p class="Pp">If successful, the
+ <code class="Fn">pthread_getaffinity_np</code>() and
+ <code class="Fn">pthread_setaffinity_np</code>() functions will return zero.
+ Otherwise an error number will be returned to indicate the error.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
+<p class="Pp">The <code class="Fn">pthread_getaffinity_np</code>() and
+ <code class="Fn">pthread_setaffinity_np</code>() functions may fail if:</p>
+<dl class="Bl-tag">
+ <dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt>
+ <dd>The <var class="Fa">cpusetp</var> argument specified when calling
+ <code class="Fn">pthread_setaffinity_np</code>() was not a valid
+ value.</dd>
+ <dt id="EDEADLK">[<a class="permalink" href="#EDEADLK"><code class="Er">EDEADLK</code></a>]</dt>
+ <dd>The <code class="Fn">pthread_setaffinity_np</code>() call would leave a
+ thread without a valid CPU to run on because the set does not overlap with
+ the thread's anonymous mask.</dd>
+ <dt id="EFAULT">[<a class="permalink" href="#EFAULT"><code class="Er">EFAULT</code></a>]</dt>
+ <dd>The <var class="Fa">cpusetp</var> pointer passed was invalid.</dd>
+ <dt id="ESRCH">[<a class="permalink" href="#ESRCH"><code class="Er">ESRCH</code></a>]</dt>
+ <dd>The thread specified by the <var class="Fa">td</var> argument could not be
+ found.</dd>
+ <dt id="ERANGE">[<a class="permalink" href="#ERANGE"><code class="Er">ERANGE</code></a>]</dt>
+ <dd>The <var class="Fa">cpusetsize</var> was smaller than needed to fit all of
+ the matching CPUs.</dd>
+ <dt id="EPERM">[<a class="permalink" href="#EPERM"><code class="Er">EPERM</code></a>]</dt>
+ <dd>The calling thread did not have the credentials required to complete the
+ operation.</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">cpuset(1)</a>, <a class="Xr">cpuset(2)</a>,
+ <a class="Xr">cpuset_getid(2)</a>, <a class="Xr">cpuset_setid(2)</a>,
+ <a class="Xr">pthread(3)</a>,
+ <a class="Xr">pthread_attr_getaffinity_np(3)</a>,
+ <a class="Xr">pthread_attr_setaffinity_np(3)</a>,
+ <a class="Xr">pthread_np(3)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
+<p class="Pp">The <code class="Nm">pthread_getaffinity_np</code> and
+ <code class="Nm">pthread_setaffinity_np</code> functions are non-standard
+ <span class="Ux">FreeBSD</span> extensions and may be not available on other
+ operating systems.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
+<p class="Pp">The <code class="Nm">pthread_getaffinity_np</code> and
+ <code class="Nm">pthread_setaffinity_np</code> function first appeared in
+ <span class="Ux">FreeBSD 7.2</span>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp">The <code class="Nm">pthread_getaffinity_np</code> and
+ <code class="Nm">pthread_setaffinity_np</code> functions were written by
+ <span class="An">David Xu</span>
+ &lt;<a class="Mt" href="mailto:davidxu@FreeBSD.org">davidxu@FreeBSD.org</a>&gt;,
+ and this manpage was written by <span class="An">Xin LI</span>
+ &lt;<a class="Mt" href="mailto:delphij@FreeBSD.org">delphij@FreeBSD.org</a>&gt;.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">January 29, 2023</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>