summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/pthread_key_create.3 3.html
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
commitac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (patch)
tree9367490586c84cba28652e443e3166d66c33b0d9 /static/freebsd/man3/pthread_key_create.3 3.html
parent253e67c8b3a72b3a4757fdbc5845297628db0a4a (diff)
docs: Added All FreeBSD Manuals
Diffstat (limited to 'static/freebsd/man3/pthread_key_create.3 3.html')
-rw-r--r--static/freebsd/man3/pthread_key_create.3 3.html96
1 files changed, 96 insertions, 0 deletions
diff --git a/static/freebsd/man3/pthread_key_create.3 3.html b/static/freebsd/man3/pthread_key_create.3 3.html
new file mode 100644
index 00000000..58110c8d
--- /dev/null
+++ b/static/freebsd/man3/pthread_key_create.3 3.html
@@ -0,0 +1,96 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">PTHREAD_KEY_CREATE(3)</td>
+ <td class="head-vol">Library Functions Manual</td>
+ <td class="head-rtitle">PTHREAD_KEY_CREATE(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_key_create</code> &#x2014;
+ <span class="Nd">thread-specific data key creation</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.h</a>&gt;</code></p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_key_create</code>(<var class="Fa" style="white-space: nowrap;">pthread_key_t
+ *key</var>, <var class="Fa" style="white-space: nowrap;">void
+ (*destructor)(void *)</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_key_create"><code class="Fn" id="pthread_key_create">pthread_key_create</code></a>()
+ function creates a thread-specific data key visible to all threads in the
+ process. Key values provided by <code class="Fn">pthread_key_create</code>()
+ are opaque objects used to locate thread-specific data. Although the same
+ key value may be used by different threads, the values bound to the key by
+ <a class="permalink" href="#pthread_setspecific"><code class="Fn" id="pthread_setspecific">pthread_setspecific</code></a>()
+ are maintained on a per-thread basis and persist for the life of the calling
+ thread.</p>
+<p class="Pp">Upon key creation, the value NULL is associated with the new key
+ in all active threads. Upon thread creation, the value NULL is associated
+ with all defined keys in the new thread.</p>
+<p class="Pp">An optional destructor function may be associated with each key
+ value. At thread exit, if a key value has a non-NULL destructor pointer, and
+ the thread has a non-NULL value associated with the key, the function
+ pointed to is called with the current associated value as its sole argument.
+ The order of destructor calls is unspecified if more than one destructor
+ exists for a thread when it exits.</p>
+<p class="Pp">If, after all the destructors have been called for all non-NULL
+ values with associated destructors, there are still some non-NULL values
+ with associated destructors, then the process is repeated. If, after at
+ least [PTHREAD_DESTRUCTOR_ITERATIONS] iterations of destructor calls for
+ outstanding non-NULL values, there are still some non-NULL values with
+ associated destructors, the implementation stops calling destructors.</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_key_create</code>()
+ function will store the newly created key value at the location specified by
+ <var class="Fa">key</var> and returns 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_key_create</code>() function will
+ fail if:</p>
+<dl class="Bl-tag">
+ <dt id="EAGAIN">[<a class="permalink" href="#EAGAIN"><code class="Er">EAGAIN</code></a>]</dt>
+ <dd>The system lacked the necessary resources to create another
+ thread-specific data key, or the system-imposed limit on the total number
+ of keys per process [PTHREAD_KEYS_MAX] would be exceeded.</dd>
+ <dt id="ENOMEM">[<a class="permalink" href="#ENOMEM"><code class="Er">ENOMEM</code></a>]</dt>
+ <dd>Insufficient memory exists to create the key.</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_getspecific(3)</a>,
+ <a class="Xr">pthread_key_delete(3)</a>,
+ <a class="Xr">pthread_setspecific(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="Fn">pthread_key_create</code>() function conforms
+ to <span class="St">ISO/IEC 9945-1:1996
+ (&#x201C;POSIX.1&#x201D;)</span>.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">April 4, 1996</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>