diff options
Diffstat (limited to 'static/freebsd/man3/pthread_attr_get_np.3 3.html')
| -rw-r--r-- | static/freebsd/man3/pthread_attr_get_np.3 3.html | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/static/freebsd/man3/pthread_attr_get_np.3 3.html b/static/freebsd/man3/pthread_attr_get_np.3 3.html new file mode 100644 index 00000000..44e831a4 --- /dev/null +++ b/static/freebsd/man3/pthread_attr_get_np.3 3.html @@ -0,0 +1,122 @@ +<table class="head"> + <tr> + <td class="head-ltitle">PTHREAD_ATTR_GET_NP(3)</td> + <td class="head-vol">Library Functions Manual</td> + <td class="head-rtitle">PTHREAD_ATTR_GET_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_attr_get_np</code> — + <span class="Nd">get attributes of an existing thread</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 + <<a class="In">pthread_np.h</a>></code></p> +<p class="Pp"><var class="Ft">int</var> + <br/> + <code class="Fn">pthread_attr_get_np</code>(<var class="Fa" style="white-space: nowrap;">pthread_t + pid</var>, <var class="Fa" style="white-space: nowrap;">pthread_attr_t + *dst</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="#pthread_attr_get_np"><code class="Fn" id="pthread_attr_get_np">pthread_attr_get_np</code></a>() + function is used to retrieve the attributes of the specified thread into an + existing <var class="Vt">pthread_attr_t</var> structure. The attributes' + values are the current ones for the target thread, except for the stack top + address if not properly aligned for the architecture, since in this case its + value has been adjusted internally before use.</p> +<p class="Pp" id="pthread_attr_get_np~2">Argument <var class="Fa">dst</var> must + be a pointer to a valid attributes object (it was initialized at some point + by <a class="Xr">pthread_attr_init(3)</a> and was not destroyed since then). + After a successful call to + <a class="permalink" href="#pthread_attr_get_np~2"><code class="Fn">pthread_attr_get_np</code></a>(), + the individual attributes' values can be retrieved as usual via the + corresponding accessor functions as documented in + <a class="Xr">pthread_attr(3)</a>. After a failed call to + <code class="Fn">pthread_attr_get_np</code>(), the object pointed to by + <var class="Fa">dst</var> is left unmodified, and can continue to be used as + if the failed call never happened.</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, <code class="Fn">pthread_attr_get_np</code>() + function returns 0. Otherwise, an error number is returned to indicate the + error.</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> +<p class="Pp">This function retrieves the stack size of the thread specified by + the <var class="Fa">pid</var> argument:</p> +<div class="Bd Pp Li"> +<pre>size_t +my_thread_stack_size(pthread_t tid) +{ + pthread_attr_t attr; + size_t size; + + pthread_attr_init(&attr); + pthread_attr_get_np(tid, &attr); + pthread_attr_getstacksize(&attr, &size); + pthread_attr_destroy(&attr); + return (size); +}</pre> +</div> +</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_attr_get_np</code>() function will + fail if:</p> +<dl class="Bl-tag"> + <dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt> + <dd>One of the arguments has an invalid value.</dd> + <dt id="ESRCH">[<a class="permalink" href="#ESRCH"><code class="Er">ESRCH</code></a>]</dt> + <dd>No thread could be found corresponding to that specified by the given + thread ID.</dd> + <dt id="ENOMEM">[<a class="permalink" href="#ENOMEM"><code class="Er">ENOMEM</code></a>]</dt> + <dd>There was not enough memory to allocate additional storage needed by the + attributes object's implementation.</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">pthread_attr(3)</a>, + <a class="Xr">pthread_attr_destroy(3)</a>, + <a class="Xr">pthread_attr_getdetachstate(3)</a>, + <a class="Xr">pthread_attr_getinheritsched(3)</a>, + <a class="Xr">pthread_attr_getschedparam(3)</a>, + <a class="Xr">pthread_attr_getschedpolicy(3)</a>, + <a class="Xr">pthread_attr_getscope(3)</a>, + <a class="Xr">pthread_attr_getstack(3)</a>, + <a class="Xr">pthread_attr_getstackaddr(3)</a>, + <a class="Xr">pthread_attr_getstacksize(3)</a>, + <a class="Xr">pthread_attr_init(3)</a>, <a class="Xr">pthread_np(3)</a></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> +<p class="Pp">The <code class="Fn">pthread_attr_get_np</code>() function and + this manual page were written by <span class="An">Alexey Zelkin</span> + <<a class="Mt" href="mailto:phantom@FreeBSD.org">phantom@FreeBSD.org</a>>, + and the latter was revised by + <br/> + <span class="An">Olivier Certner</span> + <<a class="Mt" href="mailto:olce@FreeBSD.org">olce@FreeBSD.org</a>>.</p> +</section> +</div> +<table class="foot"> + <tr> + <td class="foot-date">January 5, 2024</td> + <td class="foot-os">FreeBSD 15.0</td> + </tr> +</table> |
