Debian Codegraph @

templates/man3/pthread_key_create.3.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "pthread_key_create"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2025-05-17"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid ""
50 "pthread_key_create, pthread_key_delete, pthread_setspecific, "
51 "pthread_getspecific - management of thread-specific data"
52 msgstr ""
53
54 #. type: SH
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 #, no-wrap
58 msgid "SYNOPSIS"
59 msgstr ""
60
61 #. type: Plain text
62 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
63 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
64 #, no-wrap
65 msgid "B<#include E<lt>pthread.hE<gt>>\n"
66 msgstr ""
67
68 #. type: Plain text
69 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
70 #: opensuse-leap-16-1 opensuse-tumbleweed
71 #, no-wrap
72 msgid ""
73 "B<int pthread_key_create(pthread_key_t *>I<key>B<,>\n"
74 "B< typeof(void (void *)) *>I<destr_function>B<;>\n"
75 "B<int pthread_key_delete(pthread_key_t >I<key>B<);>\n"
76 "B<int pthread_setspecific(pthread_key_t >I<key>B<, const void *>I<pointer>B<);>\n"
77 "B<void * pthread_getspecific(pthread_key_t >I<key>B<);>\n"
78 msgstr ""
79
80 #. type: SH
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "DESCRIPTION"
85 msgstr ""
86
87 #. type: Plain text
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 msgid ""
91 "Programs often need global or static variables that have different values in "
92 "different threads. Since threads share one memory space, this cannot be "
93 "achieved with regular variables. Thread-specific data is the POSIX threads "
94 "answer to this need."
95 msgstr ""
96
97 #. type: Plain text
98 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
99 #: opensuse-tumbleweed
100 msgid ""
101 "Each thread possesses a private memory block, the thread-specific data area, "
102 "or TSD area for short. This area is indexed by TSD keys. The TSD area "
103 "associates values of type I<void\\ *> to TSD keys. TSD keys are common to "
104 "all threads, but the value associated with a given TSD key can be different "
105 "in each thread."
106 msgstr ""
107
108 #. type: Plain text
109 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
110 #: opensuse-tumbleweed
111 msgid ""
112 "For concreteness, the TSD areas can be viewed as arrays of I<void\\ *> "
113 "pointers, TSD keys as integer indices into these arrays, and the value of a "
114 "TSD key as the value of the corresponding array element in the calling "
115 "thread."
116 msgstr ""
117
118 #. type: Plain text
119 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
120 #: opensuse-tumbleweed
121 msgid ""
122 "When a thread is created, its TSD area initially associates NULL with all "
123 "keys."
124 msgstr ""
125
126 #. type: Plain text
127 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
128 #: opensuse-tumbleweed
129 msgid ""
130 "B<pthread_key_create>() allocates a new TSD key. The key is stored in the "
131 "location pointed to by I<key>. There is a limit of B<PTHREAD_KEYS_MAX> on "
132 "the number of keys allocated at a given time. The value initially "
133 "associated with the returned key is NULL in all currently executing threads."
134 msgstr ""
135
136 #. type: Plain text
137 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
138 #: opensuse-tumbleweed
139 msgid ""
140 "The I<destr_function> argument, if not NULL, specifies a destructor function "
141 "associated with the key. When a thread terminates via B<pthread_exit>() or "
142 "by cancelation, I<destr_function> is called with arguments the value "
143 "associated with the key in that thread. The I<destr_function> is not called "
144 "if that value is NULL. The order in which destructor functions are called "
145 "at thread termination time is unspecified."
146 msgstr ""
147
148 #. type: Plain text
149 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
150 #: opensuse-tumbleweed
151 msgid ""
152 "Before the destructor function is called, the NULL value is associated with "
153 "the key in the current thread. A destructor function might, however, re-"
154 "associate non-NULL values to that key or some other key. To deal with this, "
155 "if after all the destructors have been called for all non-NULL values, there "
156 "are still some non-NULL values with associated destructors, then the process "
157 "is repeated. The glibc implementation stops the process after "
158 "B<PTHREAD_DESTRUCTOR_ITERATIONS> iterations, even if some non-NULL values "
159 "with associated descriptors remain. Other implementations may loop "
160 "indefinitely."
161 msgstr ""
162
163 #. type: Plain text
164 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
165 #: opensuse-tumbleweed
166 msgid ""
167 "B<pthread_key_delete>() deallocates a TSD key. It does not check whether "
168 "non-NULL values are associated with that key in the currently executing "
169 "threads, nor call the destructor function associated with the key."
170 msgstr ""
171
172 #. type: Plain text
173 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
174 #: opensuse-tumbleweed
175 msgid ""
176 "B<pthread_setspecific>() changes the value associated with I<key> in the "
177 "calling thread, storing the given I<pointer> instead."
178 msgstr ""
179
180 #. type: Plain text
181 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
182 #: opensuse-tumbleweed
183 msgid ""
184 "B<pthread_getspecific>() returns the value currently associated with I<key> "
185 "in the calling thread."
186 msgstr ""
187
188 #. type: SH
189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
191 #, no-wrap
192 msgid "RETURN VALUE"
193 msgstr ""
194
195 #. type: Plain text
196 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
197 #: opensuse-tumbleweed
198 msgid ""
199 "B<pthread_key_create>(), B<pthread_key_delete>(), and "
200 "B<pthread_setspecific>() return 0 on success and a non-zero error code on "
201 "failure. If successful, B<pthread_key_create>() stores the newly allocated "
202 "key in the location pointed to by its I<key> argument."
203 msgstr ""
204
205 #. type: Plain text
206 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
207 #: opensuse-tumbleweed
208 msgid ""
209 "B<pthread_getspecific>() returns the value associated with I<key> on "
210 "success, and NULL on error."
211 msgstr ""
212
213 #. type: SH
214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
216 #, no-wrap
217 msgid "ERRORS"
218 msgstr ""
219
220 #. type: Plain text
221 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
222 #: opensuse-tumbleweed
223 msgid "B<pthread_key_create>() returns the following error code on error:"
224 msgstr ""
225
226 #. type: TP
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 #, no-wrap
230 msgid "B<EAGAIN>"
231 msgstr ""
232
233 #. type: Plain text
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 msgid "B<PTHREAD_KEYS_MAX> keys are already allocated."
237 msgstr ""
238
239 #. type: Plain text
240 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
241 #: opensuse-tumbleweed
242 msgid ""
243 "B<pthread_key_delete>() and B<pthread_setspecific>() return the following "
244 "error code on error:"
245 msgstr ""
246
247 #. type: TP
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 #, no-wrap
251 msgid "B<EINVAL>"
252 msgstr ""
253
254 #. type: Plain text
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 msgid "I<key> is not a valid, allocated TSD key."
258 msgstr ""
259
260 #. type: Plain text
261 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
262 #: opensuse-tumbleweed
263 msgid ""
264 "B<pthread_getspecific>() returns NULL if I<key> is not a valid, allocated "
265 "TSD key."
266 msgstr ""
267
268 #. type: SH
269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
271 #, no-wrap
272 msgid "SEE ALSO"
273 msgstr ""
274
275 #. type: Plain text
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 msgid "pthread_create(3), pthread_exit(3), pthread_testcancel(3)."
279 msgstr ""
280
281 #. type: SH
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 #, no-wrap
285 msgid "EXAMPLE"
286 msgstr ""
287
288 #. type: Plain text
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 msgid ""
292 "The following code fragment allocates a thread-specific array of 100 "
293 "characters, with automatic reclamation at thread exit:"
294 msgstr ""
295
296 #. type: Plain text
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 #, no-wrap
300 msgid ""
301 "B</* Key for the thread-specific buffer */\n"
302 "static pthread_key_t buffer_key;\n"
303 "\\&\n"
304 "/* Once-only initialisation of the key */\n"
305 "static pthread_once_t buffer_key_once = PTHREAD_ONCE_INIT;\n"
306 "\\&\n"
307 "/* Allocate the thread-specific buffer */\n"
308 "void buffer_alloc(void)\n"
309 "{\n"
310 " pthread_once(&buffer_key_once, buffer_key_alloc);\n"
311 " pthread_setspecific(buffer_key, malloc(100));\n"
312 "}\n"
313 "\\&\n"
314 "/* Return the thread-specific buffer */\n"
315 "char * get_buffer(void)\n"
316 "{\n"
317 " return (char *) pthread_getspecific(buffer_key);\n"
318 "}\n"
319 "\\&\n"
320 "/* Allocate the key */\n"
321 "static void buffer_key_alloc()\n"
322 "{\n"
323 " pthread_key_create(&buffer_key, buffer_destroy);\n"
324 "}\n"
325 "\\&\n"
326 "/* Free the thread-specific buffer */\n"
327 "static void buffer_destroy(void * buf)\n"
328 "{\n"
329 " free(buf);\n"
330 "}>\n"
331 msgstr ""
332
333 #. type: TH
334 #: debian-trixie
335 #, no-wrap
336 msgid "2024-06-16"
337 msgstr ""
338
339 #. type: TH
340 #: debian-trixie
341 #, no-wrap
342 msgid "Linux man-pages 6.9.1"
343 msgstr ""
344
345 #. type: Plain text
346 #: debian-trixie
347 #, no-wrap
348 msgid ""
349 "B<int pthread_key_create(pthread_key_t *>I<key>B<,>\n"
350 "B< void (*>I<destr_function>B<) (void *));>\n"
351 "B<int pthread_key_delete(pthread_key_t >I<key>B<);>\n"
352 "B<int pthread_setspecific(pthread_key_t >I<key>B<, const void *>I<pointer>B<);>\n"
353 "B<void * pthread_getspecific(pthread_key_t >I<key>B<);>\n"
354 msgstr ""
355
356 #. type: Plain text
357 #: debian-trixie fedora-44 fedora-rawhide
358 msgid ""
359 "Each thread possesses a private memory block, the thread-specific data area, "
360 "or TSD area for short. This area is indexed by TSD keys. The TSD area "
361 "associates values of type B<void *> to TSD keys. TSD keys are common to all "
362 "threads, but the value associated with a given TSD key can be different in "
363 "each thread."
364 msgstr ""
365
366 #. type: Plain text
367 #: debian-trixie fedora-44 fedora-rawhide
368 msgid ""
369 "For concreteness, the TSD areas can be viewed as arrays of B<void *> "
370 "pointers, TSD keys as integer indices into these arrays, and the value of a "
371 "TSD key as the value of the corresponding array element in the calling "
372 "thread."
373 msgstr ""
374
375 #. type: Plain text
376 #: debian-trixie fedora-44 fedora-rawhide
377 msgid ""
378 "When a thread is created, its TSD area initially associates B<NULL> with all "
379 "keys."
380 msgstr ""
381
382 #. type: Plain text
383 #: debian-trixie fedora-44 fedora-rawhide
384 msgid ""
385 "B<pthread_key_create> allocates a new TSD key. The key is stored in the "
386 "location pointed to by I<key>. There is a limit of B<PTHREAD_KEYS_MAX> on "
387 "the number of keys allocated at a given time. The value initially "
388 "associated with the returned key is B<NULL> in all currently executing "
389 "threads."
390 msgstr ""
391
392 #. type: Plain text
393 #: debian-trixie fedora-44 fedora-rawhide
394 msgid ""
395 "The I<destr_function> argument, if not B<NULL>, specifies a destructor "
396 "function associated with the key. When a thread terminates via "
397 "B<pthread_exit> or by cancelation, I<destr_function> is called with "
398 "arguments the value associated with the key in that thread. The "
399 "I<destr_function> is not called if that value is B<NULL>. The order in "
400 "which destructor functions are called at thread termination time is "
401 "unspecified."
402 msgstr ""
403
404 #. type: Plain text
405 #: debian-trixie fedora-44 fedora-rawhide
406 msgid ""
407 "Before the destructor function is called, the B<NULL> value is associated "
408 "with the key in the current thread. A destructor function might, however, "
409 "re-associate non-B<NULL> values to that key or some other key. To deal with "
410 "this, if after all the destructors have been called for all non-B<NULL> "
411 "values, there are still some non-B<NULL> values with associated destructors, "
412 "then the process is repeated. The glibc implementation stops the process "
413 "after B<PTHREAD_DESTRUCTOR_ITERATIONS> iterations, even if some non-B<NULL> "
414 "values with associated descriptors remain. Other implementations may loop "
415 "indefinitely."
416 msgstr ""
417
418 #. type: Plain text
419 #: debian-trixie fedora-44 fedora-rawhide
420 msgid ""
421 "B<pthread_key_delete> deallocates a TSD key. It does not check whether non-"
422 "B<NULL> values are associated with that key in the currently executing "
423 "threads, nor call the destructor function associated with the key."
424 msgstr ""
425
426 #. type: Plain text
427 #: debian-trixie fedora-44 fedora-rawhide
428 msgid ""
429 "B<pthread_setspecific> changes the value associated with I<key> in the "
430 "calling thread, storing the given I<pointer> instead."
431 msgstr ""
432
433 #. type: Plain text
434 #: debian-trixie fedora-44 fedora-rawhide
435 msgid ""
436 "B<pthread_getspecific> returns the value currently associated with I<key> in "
437 "the calling thread."
438 msgstr ""
439
440 #. type: Plain text
441 #: debian-trixie fedora-44 fedora-rawhide
442 msgid ""
443 "B<pthread_key_create>, B<pthread_key_delete>, and B<pthread_setspecific> "
444 "return 0 on success and a non-zero error code on failure. If successful, "
445 "B<pthread_key_create> stores the newly allocated key in the location pointed "
446 "to by its I<key> argument."
447 msgstr ""
448
449 #. type: Plain text
450 #: debian-trixie fedora-44 fedora-rawhide
451 msgid ""
452 "B<pthread_getspecific> returns the value associated with I<key> on success, "
453 "and B<NULL> on error."
454 msgstr ""
455
456 #. type: Plain text
457 #: debian-trixie fedora-44 fedora-rawhide
458 msgid "B<pthread_key_create> returns the following error code on error:"
459 msgstr ""
460
461 #. type: Plain text
462 #: debian-trixie fedora-44 fedora-rawhide
463 msgid ""
464 "B<pthread_key_delete> and B<pthread_setspecific> return the following error "
465 "code on error:"
466 msgstr ""
467
468 #. type: Plain text
469 #: debian-trixie fedora-44 fedora-rawhide
470 msgid ""
471 "B<pthread_getspecific> returns B<NULL> if I<key> is not a valid, allocated "
472 "TSD key."
473 msgstr ""
474
475 #. type: TH
476 #: fedora-44 fedora-rawhide
477 #, no-wrap
478 msgid "2025-01-11"
479 msgstr ""
480
481 #. type: TH
482 #: fedora-44 fedora-rawhide
483 #, no-wrap
484 msgid "Linux man-pages 6.13"
485 msgstr ""
486
487 #. type: TH
488 #: mageia-cauldron
489 #, no-wrap
490 msgid "Linux man-pages 6.17"
491 msgstr ""
492
493 #. type: TH
494 #: opensuse-leap-16-1 opensuse-tumbleweed
495 #, no-wrap
496 msgid "Linux man-pages (unreleased)"
497 msgstr ""