Debian Codegraph @

templates/man7/attributes.7.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:18+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 "attributes"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
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 "attributes - POSIX safety concepts"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "DESCRIPTION"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 msgid ""
63 "I<Note>: the text of this man page is based on the material taken from the "
64 "\"POSIX Safety Concepts\" section of the GNU C Library manual. Further "
65 "details on the topics described here can be found in that manual."
66 msgstr ""
67
68 #. type: Plain text
69 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
70 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
71 msgid ""
72 "Various function manual pages include a section ATTRIBUTES that describes "
73 "the safety of calling the function in various contexts. This section "
74 "annotates functions with the following safety markings:"
75 msgstr ""
76
77 #. type: TP
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "I<MT-Safe>"
82 msgstr ""
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 msgid ""
88 "I<MT-Safe> or Thread-Safe functions are safe to call in the presence of "
89 "other threads. MT, in MT-Safe, stands for Multi Thread."
90 msgstr ""
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 msgid ""
96 "Being MT-Safe does not imply a function is atomic, nor that it uses any of "
97 "the memory synchronization mechanisms POSIX exposes to users. It is even "
98 "possible that calling MT-Safe functions in sequence does not yield an MT-"
99 "Safe combination. For example, having a thread call two MT-Safe functions "
100 "one right after the other does not guarantee behavior equivalent to atomic "
101 "execution of a combination of both functions, since concurrent calls in "
102 "other threads may interfere in a destructive way."
103 msgstr ""
104
105 #
106 #
107 #
108 #. .TP
109 #. .I AS-Safe
110 #. .I AS-Safe
111 #. or Async-Signal-Safe functions are safe to call from
112 #. asynchronous signal handlers.
113 #. AS, in AS-Safe, stands for Asynchronous Signal.
114 #. Many functions that are AS-Safe may set
115 #. .IR errno ,
116 #. or modify the floating-point environment,
117 #. because their doing so does not make them
118 #. unsuitable for use in signal handlers.
119 #. However, programs could misbehave should asynchronous signal handlers
120 #. modify this thread-local state,
121 #. and the signal handling machinery cannot be counted on to
122 #. preserve it.
123 #. Therefore, signal handlers that call functions that may set
124 #. .I errno
125 #. or modify the floating-point environment
126 #. .I must
127 #. save their original values, and restore them before returning.
128 #. .TP
129 #. .I AC-Safe
130 #. .I AC-Safe
131 #. or Async-Cancel-Safe functions are safe to call when
132 #. asynchronous cancelation is enabled.
133 #. AC in AC-Safe stands for Asynchronous Cancelation.
134 #. The POSIX standard defines only three functions to be AC-Safe, namely
135 #. .BR pthread_cancel (3),
136 #. .BR pthread_setcancelstate (3),
137 #. and
138 #. .BR pthread_setcanceltype (3).
139 #. At present the GNU C Library provides no
140 #. guarantees beyond these three functions,
141 #. but does document which functions are presently AC-Safe.
142 #. This documentation is provided for use
143 #. by the GNU C Library developers.
144 #. Just like signal handlers, cancelation cleanup routines must configure
145 #. the floating point environment they require.
146 #. The routines cannot assume a floating point environment,
147 #. particularly when asynchronous cancelation is enabled.
148 #. If the configuration of the floating point
149 #. environment cannot be performed atomically then it is also possible that
150 #. the environment encountered is internally inconsistent.
151 #. type: Plain text
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 msgid ""
155 "Whole-program optimizations that could inline functions across library "
156 "interfaces may expose unsafe reordering, and so performing inlining across "
157 "the GNU C Library interface is not recommended. The documented MT-Safety "
158 "status is not guaranteed under whole-program optimization. However, "
159 "functions defined in user-visible headers are designed to be safe for "
160 "inlining."
161 msgstr ""
162
163 #. #-#-#-#-# archlinux: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
164 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
165 #. type: TP
166 #. #-#-#-#-# debian-trixie: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
167 #. ", " AS-Unsafe ", " AC-Unsafe
168 #. type: TP
169 #. #-#-#-#-# debian-unstable: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
170 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
171 #. type: TP
172 #. #-#-#-#-# fedora-44: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
173 #. ", " AS-Unsafe ", " AC-Unsafe
174 #. type: TP
175 #. #-#-#-#-# fedora-rawhide: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
176 #. ", " AS-Unsafe ", " AC-Unsafe
177 #. type: TP
178 #. #-#-#-#-# mageia-cauldron: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
179 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
180 #. type: TP
181 #. #-#-#-#-# opensuse-leap-16-1: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
182 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
183 #. type: TP
184 #. #-#-#-#-# opensuse-tumbleweed: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
185 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
186 #. type: TP
187 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
188 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
189 #, no-wrap
190 msgid "I<MT-Unsafe>"
191 msgstr ""
192
193 #
194 #
195 #
196 #
197 #
198 #
199 #. #-#-#-#-# archlinux: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
200 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
201 #. functions are not
202 #. safe to call within the safety contexts described above.
203 #. Calling them
204 #. within such contexts invokes undefined behavior.
205 #. Functions not explicitly documented as safe in a safety context should
206 #. be regarded as Unsafe.
207 #. .TP
208 #. .I Preliminary
209 #. .I Preliminary
210 #. safety properties are documented, indicating these
211 #. properties may
212 #. .I not
213 #. be counted on in future releases of
214 #. the GNU C Library.
215 #. Such preliminary properties are the result of an assessment of the
216 #. properties of our current implementation,
217 #. rather than of what is mandated and permitted
218 #. by current and future standards.
219 #. Although we strive to abide by the standards, in some cases our
220 #. implementation is safe even when the standard does not demand safety,
221 #. and in other cases our implementation does not meet the standard safety
222 #. requirements.
223 #. The latter are most likely bugs; the former, when marked
224 #. as
225 #. .IR Preliminary ,
226 #. should not be counted on: future standards may
227 #. require changes that are not compatible with the additional safety
228 #. properties afforded by the current implementation.
229 #. Furthermore,
230 #. the POSIX standard does not offer a detailed definition of safety.
231 #. We assume that, by "safe to call", POSIX means that,
232 #. as long as the program does not invoke undefined behavior,
233 #. the "safe to call" function behaves as specified,
234 #. and does not cause other functions to deviate from their specified behavior.
235 #. We have chosen to use its loose
236 #. definitions of safety, not because they are the best definitions to use,
237 #. but because choosing them harmonizes this manual with POSIX.
238 #. Please keep in mind that these are preliminary definitions and annotations,
239 #. and certain aspects of the definitions are still under
240 #. discussion and might be subject to clarification or change.
241 #. Over time,
242 #. we envision evolving the preliminary safety notes into stable commitments,
243 #. as stable as those of our interfaces.
244 #. As we do, we will remove the
245 #. .I Preliminary
246 #. keyword from safety notes.
247 #. As long as the keyword remains, however,
248 #. they are not to be regarded as a promise of future behavior.
249 #. type: Plain text
250 #. #-#-#-#-# debian-trixie: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
251 #. ", " AS-Unsafe ", " AC-Unsafe
252 #. functions are not
253 #. safe to call within the safety contexts described above.
254 #. Calling them
255 #. within such contexts invokes undefined behavior.
256 #. Functions not explicitly documented as safe in a safety context should
257 #. be regarded as Unsafe.
258 #. .TP
259 #. .I Preliminary
260 #. .I Preliminary
261 #. safety properties are documented, indicating these
262 #. properties may
263 #. .I not
264 #. be counted on in future releases of
265 #. the GNU C Library.
266 #. Such preliminary properties are the result of an assessment of the
267 #. properties of our current implementation,
268 #. rather than of what is mandated and permitted
269 #. by current and future standards.
270 #. Although we strive to abide by the standards, in some cases our
271 #. implementation is safe even when the standard does not demand safety,
272 #. and in other cases our implementation does not meet the standard safety
273 #. requirements.
274 #. The latter are most likely bugs; the former, when marked
275 #. as
276 #. .IR Preliminary ,
277 #. should not be counted on: future standards may
278 #. require changes that are not compatible with the additional safety
279 #. properties afforded by the current implementation.
280 #. Furthermore,
281 #. the POSIX standard does not offer a detailed definition of safety.
282 #. We assume that, by "safe to call", POSIX means that,
283 #. as long as the program does not invoke undefined behavior,
284 #. the "safe to call" function behaves as specified,
285 #. and does not cause other functions to deviate from their specified behavior.
286 #. We have chosen to use its loose
287 #. definitions of safety, not because they are the best definitions to use,
288 #. but because choosing them harmonizes this manual with POSIX.
289 #. Please keep in mind that these are preliminary definitions and annotations,
290 #. and certain aspects of the definitions are still under
291 #. discussion and might be subject to clarification or change.
292 #. Over time,
293 #. we envision evolving the preliminary safety notes into stable commitments,
294 #. as stable as those of our interfaces.
295 #. As we do, we will remove the
296 #. .I Preliminary
297 #. keyword from safety notes.
298 #. As long as the keyword remains, however,
299 #. they are not to be regarded as a promise of future behavior.
300 #. type: Plain text
301 #. #-#-#-#-# debian-unstable: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
302 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
303 #. functions are not
304 #. safe to call within the safety contexts described above.
305 #. Calling them
306 #. within such contexts invokes undefined behavior.
307 #. Functions not explicitly documented as safe in a safety context should
308 #. be regarded as Unsafe.
309 #. .TP
310 #. .I Preliminary
311 #. .I Preliminary
312 #. safety properties are documented, indicating these
313 #. properties may
314 #. .I not
315 #. be counted on in future releases of
316 #. the GNU C Library.
317 #. Such preliminary properties are the result of an assessment of the
318 #. properties of our current implementation,
319 #. rather than of what is mandated and permitted
320 #. by current and future standards.
321 #. Although we strive to abide by the standards, in some cases our
322 #. implementation is safe even when the standard does not demand safety,
323 #. and in other cases our implementation does not meet the standard safety
324 #. requirements.
325 #. The latter are most likely bugs; the former, when marked
326 #. as
327 #. .IR Preliminary ,
328 #. should not be counted on: future standards may
329 #. require changes that are not compatible with the additional safety
330 #. properties afforded by the current implementation.
331 #. Furthermore,
332 #. the POSIX standard does not offer a detailed definition of safety.
333 #. We assume that, by "safe to call", POSIX means that,
334 #. as long as the program does not invoke undefined behavior,
335 #. the "safe to call" function behaves as specified,
336 #. and does not cause other functions to deviate from their specified behavior.
337 #. We have chosen to use its loose
338 #. definitions of safety, not because they are the best definitions to use,
339 #. but because choosing them harmonizes this manual with POSIX.
340 #. Please keep in mind that these are preliminary definitions and annotations,
341 #. and certain aspects of the definitions are still under
342 #. discussion and might be subject to clarification or change.
343 #. Over time,
344 #. we envision evolving the preliminary safety notes into stable commitments,
345 #. as stable as those of our interfaces.
346 #. As we do, we will remove the
347 #. .I Preliminary
348 #. keyword from safety notes.
349 #. As long as the keyword remains, however,
350 #. they are not to be regarded as a promise of future behavior.
351 #. type: Plain text
352 #. #-#-#-#-# fedora-44: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
353 #. ", " AS-Unsafe ", " AC-Unsafe
354 #. functions are not
355 #. safe to call within the safety contexts described above.
356 #. Calling them
357 #. within such contexts invokes undefined behavior.
358 #. Functions not explicitly documented as safe in a safety context should
359 #. be regarded as Unsafe.
360 #. .TP
361 #. .I Preliminary
362 #. .I Preliminary
363 #. safety properties are documented, indicating these
364 #. properties may
365 #. .I not
366 #. be counted on in future releases of
367 #. the GNU C Library.
368 #. Such preliminary properties are the result of an assessment of the
369 #. properties of our current implementation,
370 #. rather than of what is mandated and permitted
371 #. by current and future standards.
372 #. Although we strive to abide by the standards, in some cases our
373 #. implementation is safe even when the standard does not demand safety,
374 #. and in other cases our implementation does not meet the standard safety
375 #. requirements.
376 #. The latter are most likely bugs; the former, when marked
377 #. as
378 #. .IR Preliminary ,
379 #. should not be counted on: future standards may
380 #. require changes that are not compatible with the additional safety
381 #. properties afforded by the current implementation.
382 #. Furthermore,
383 #. the POSIX standard does not offer a detailed definition of safety.
384 #. We assume that, by "safe to call", POSIX means that,
385 #. as long as the program does not invoke undefined behavior,
386 #. the "safe to call" function behaves as specified,
387 #. and does not cause other functions to deviate from their specified behavior.
388 #. We have chosen to use its loose
389 #. definitions of safety, not because they are the best definitions to use,
390 #. but because choosing them harmonizes this manual with POSIX.
391 #. Please keep in mind that these are preliminary definitions and annotations,
392 #. and certain aspects of the definitions are still under
393 #. discussion and might be subject to clarification or change.
394 #. Over time,
395 #. we envision evolving the preliminary safety notes into stable commitments,
396 #. as stable as those of our interfaces.
397 #. As we do, we will remove the
398 #. .I Preliminary
399 #. keyword from safety notes.
400 #. As long as the keyword remains, however,
401 #. they are not to be regarded as a promise of future behavior.
402 #. type: Plain text
403 #. #-#-#-#-# fedora-rawhide: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
404 #. ", " AS-Unsafe ", " AC-Unsafe
405 #. functions are not
406 #. safe to call within the safety contexts described above.
407 #. Calling them
408 #. within such contexts invokes undefined behavior.
409 #. Functions not explicitly documented as safe in a safety context should
410 #. be regarded as Unsafe.
411 #. .TP
412 #. .I Preliminary
413 #. .I Preliminary
414 #. safety properties are documented, indicating these
415 #. properties may
416 #. .I not
417 #. be counted on in future releases of
418 #. the GNU C Library.
419 #. Such preliminary properties are the result of an assessment of the
420 #. properties of our current implementation,
421 #. rather than of what is mandated and permitted
422 #. by current and future standards.
423 #. Although we strive to abide by the standards, in some cases our
424 #. implementation is safe even when the standard does not demand safety,
425 #. and in other cases our implementation does not meet the standard safety
426 #. requirements.
427 #. The latter are most likely bugs; the former, when marked
428 #. as
429 #. .IR Preliminary ,
430 #. should not be counted on: future standards may
431 #. require changes that are not compatible with the additional safety
432 #. properties afforded by the current implementation.
433 #. Furthermore,
434 #. the POSIX standard does not offer a detailed definition of safety.
435 #. We assume that, by "safe to call", POSIX means that,
436 #. as long as the program does not invoke undefined behavior,
437 #. the "safe to call" function behaves as specified,
438 #. and does not cause other functions to deviate from their specified behavior.
439 #. We have chosen to use its loose
440 #. definitions of safety, not because they are the best definitions to use,
441 #. but because choosing them harmonizes this manual with POSIX.
442 #. Please keep in mind that these are preliminary definitions and annotations,
443 #. and certain aspects of the definitions are still under
444 #. discussion and might be subject to clarification or change.
445 #. Over time,
446 #. we envision evolving the preliminary safety notes into stable commitments,
447 #. as stable as those of our interfaces.
448 #. As we do, we will remove the
449 #. .I Preliminary
450 #. keyword from safety notes.
451 #. As long as the keyword remains, however,
452 #. they are not to be regarded as a promise of future behavior.
453 #. type: Plain text
454 #. #-#-#-#-# mageia-cauldron: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
455 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
456 #. functions are not
457 #. safe to call within the safety contexts described above.
458 #. Calling them
459 #. within such contexts invokes undefined behavior.
460 #. Functions not explicitly documented as safe in a safety context should
461 #. be regarded as Unsafe.
462 #. .TP
463 #. .I Preliminary
464 #. .I Preliminary
465 #. safety properties are documented, indicating these
466 #. properties may
467 #. .I not
468 #. be counted on in future releases of
469 #. the GNU C Library.
470 #. Such preliminary properties are the result of an assessment of the
471 #. properties of our current implementation,
472 #. rather than of what is mandated and permitted
473 #. by current and future standards.
474 #. Although we strive to abide by the standards, in some cases our
475 #. implementation is safe even when the standard does not demand safety,
476 #. and in other cases our implementation does not meet the standard safety
477 #. requirements.
478 #. The latter are most likely bugs; the former, when marked
479 #. as
480 #. .IR Preliminary ,
481 #. should not be counted on: future standards may
482 #. require changes that are not compatible with the additional safety
483 #. properties afforded by the current implementation.
484 #. Furthermore,
485 #. the POSIX standard does not offer a detailed definition of safety.
486 #. We assume that, by "safe to call", POSIX means that,
487 #. as long as the program does not invoke undefined behavior,
488 #. the "safe to call" function behaves as specified,
489 #. and does not cause other functions to deviate from their specified behavior.
490 #. We have chosen to use its loose
491 #. definitions of safety, not because they are the best definitions to use,
492 #. but because choosing them harmonizes this manual with POSIX.
493 #. Please keep in mind that these are preliminary definitions and annotations,
494 #. and certain aspects of the definitions are still under
495 #. discussion and might be subject to clarification or change.
496 #. Over time,
497 #. we envision evolving the preliminary safety notes into stable commitments,
498 #. as stable as those of our interfaces.
499 #. As we do, we will remove the
500 #. .I Preliminary
501 #. keyword from safety notes.
502 #. As long as the keyword remains, however,
503 #. they are not to be regarded as a promise of future behavior.
504 #. type: Plain text
505 #. #-#-#-#-# opensuse-leap-16-1: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
506 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
507 #. functions are not
508 #. safe to call within the safety contexts described above.
509 #. Calling them
510 #. within such contexts invokes undefined behavior.
511 #. Functions not explicitly documented as safe in a safety context should
512 #. be regarded as Unsafe.
513 #. .TP
514 #. .I Preliminary
515 #. .I Preliminary
516 #. safety properties are documented, indicating these
517 #. properties may
518 #. .I not
519 #. be counted on in future releases of
520 #. the GNU C Library.
521 #. Such preliminary properties are the result of an assessment of the
522 #. properties of our current implementation,
523 #. rather than of what is mandated and permitted
524 #. by current and future standards.
525 #. Although we strive to abide by the standards, in some cases our
526 #. implementation is safe even when the standard does not demand safety,
527 #. and in other cases our implementation does not meet the standard safety
528 #. requirements.
529 #. The latter are most likely bugs; the former, when marked
530 #. as
531 #. .IR Preliminary ,
532 #. should not be counted on: future standards may
533 #. require changes that are not compatible with the additional safety
534 #. properties afforded by the current implementation.
535 #. Furthermore,
536 #. the POSIX standard does not offer a detailed definition of safety.
537 #. We assume that, by "safe to call", POSIX means that,
538 #. as long as the program does not invoke undefined behavior,
539 #. the "safe to call" function behaves as specified,
540 #. and does not cause other functions to deviate from their specified behavior.
541 #. We have chosen to use its loose
542 #. definitions of safety, not because they are the best definitions to use,
543 #. but because choosing them harmonizes this manual with POSIX.
544 #. Please keep in mind that these are preliminary definitions and annotations,
545 #. and certain aspects of the definitions are still under
546 #. discussion and might be subject to clarification or change.
547 #. Over time,
548 #. we envision evolving the preliminary safety notes into stable commitments,
549 #. as stable as those of our interfaces.
550 #. As we do, we will remove the
551 #. .I Preliminary
552 #. keyword from safety notes.
553 #. As long as the keyword remains, however,
554 #. they are not to be regarded as a promise of future behavior.
555 #. type: Plain text
556 #. #-#-#-#-# opensuse-tumbleweed: attributes.7.pot (PACKAGE VERSION) #-#-#-#-#
557 #. ,\~ AS-Unsafe ,\~ AC-Unsafe
558 #. functions are not
559 #. safe to call within the safety contexts described above.
560 #. Calling them
561 #. within such contexts invokes undefined behavior.
562 #. Functions not explicitly documented as safe in a safety context should
563 #. be regarded as Unsafe.
564 #. .TP
565 #. .I Preliminary
566 #. .I Preliminary
567 #. safety properties are documented, indicating these
568 #. properties may
569 #. .I not
570 #. be counted on in future releases of
571 #. the GNU C Library.
572 #. Such preliminary properties are the result of an assessment of the
573 #. properties of our current implementation,
574 #. rather than of what is mandated and permitted
575 #. by current and future standards.
576 #. Although we strive to abide by the standards, in some cases our
577 #. implementation is safe even when the standard does not demand safety,
578 #. and in other cases our implementation does not meet the standard safety
579 #. requirements.
580 #. The latter are most likely bugs; the former, when marked
581 #. as
582 #. .IR Preliminary ,
583 #. should not be counted on: future standards may
584 #. require changes that are not compatible with the additional safety
585 #. properties afforded by the current implementation.
586 #. Furthermore,
587 #. the POSIX standard does not offer a detailed definition of safety.
588 #. We assume that, by "safe to call", POSIX means that,
589 #. as long as the program does not invoke undefined behavior,
590 #. the "safe to call" function behaves as specified,
591 #. and does not cause other functions to deviate from their specified behavior.
592 #. We have chosen to use its loose
593 #. definitions of safety, not because they are the best definitions to use,
594 #. but because choosing them harmonizes this manual with POSIX.
595 #. Please keep in mind that these are preliminary definitions and annotations,
596 #. and certain aspects of the definitions are still under
597 #. discussion and might be subject to clarification or change.
598 #. Over time,
599 #. we envision evolving the preliminary safety notes into stable commitments,
600 #. as stable as those of our interfaces.
601 #. As we do, we will remove the
602 #. .I Preliminary
603 #. keyword from safety notes.
604 #. As long as the keyword remains, however,
605 #. they are not to be regarded as a promise of future behavior.
606 #. type: Plain text
607 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
608 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
609 msgid ""
610 "I<MT-Unsafe> functions are not safe to call in a multithreaded programs."
611 msgstr ""
612
613 #
614 #
615 #
616 #
617 #
618 #
619 #
620 #
621 #
622 #
623 #
624 #. .SS Unsafe features
625 #. Functions that are unsafe to call in certain contexts are annotated with
626 #. keywords that document their features that make them unsafe to call.
627 #. AS-Unsafe features in this section indicate the functions are never safe
628 #. to call when asynchronous signals are enabled.
629 #. AC-Unsafe features
630 #. indicate they are never safe to call when asynchronous cancelation is
631 #. .\" enabled.
632 #. There are no MT-Unsafe marks in this section.
633 #. .TP
634 #. .\" .I code
635 #. Functions marked with
636 #. .I lock
637 #. as an AS-Unsafe feature may be
638 #. .\" interrupted by a signal while holding a non-recursive lock.
639 #. If the signal handler calls another such function that takes the same lock,
640 #. the result is a deadlock.
641 #. Functions annotated with
642 #. .I lock
643 #. as an AC-Unsafe feature may, if canceled asynchronously,
644 #. fail to release a lock that would have been released if their execution
645 #. had not been interrupted by asynchronous thread cancelation.
646 #. Once a lock is left taken,
647 #. attempts to take that lock will block indefinitely.
648 #. .TP
649 #. .I corrupt
650 #. Functions marked with
651 #. .\" .I corrupt
652 #. as an AS-Unsafe feature may corrupt
653 #. data structures and misbehave when they interrupt,
654 #. or are interrupted by, another such function.
655 #. Unlike functions marked with
656 #. .IR lock ,
657 #. these take recursive locks to avoid MT-Safety problems,
658 #. but this is not enough to stop a signal handler from observing
659 #. a partially-updated data structure.
660 #. Further corruption may arise from the interrupted function's
661 #. failure to notice updates made by signal handlers.
662 #. Functions marked with
663 #. .I corrupt
664 #. as an AC-Unsafe feature may leave
665 #. data structures in a corrupt, partially updated state.
666 #. Subsequent uses of the data structure may misbehave.
667 #. .\" A special case, probably not worth documenting separately, involves
668 #. .\" reallocing, or even freeing pointers. Any case involving free could
669 #. .\" be easily turned into an ac-safe leak by resetting the pointer before
670 #. .\" releasing it; I don't think we have any case that calls for this sort
671 #. .\" of fixing. Fixing the realloc cases would require a new interface:
672 #. .\" instead of @code{ptr=realloc(ptr,size)} we'd have to introduce
673 #. .\" @code{acsafe_realloc(&ptr,size)} that would modify ptr before
674 #. .\" releasing the old memory. The ac-unsafe realloc could be implemented
675 #. .\" in terms of an internal interface with this semantics (say
676 #. .\" __acsafe_realloc), but since realloc can be overridden, the function
677 #. .\" we call to implement realloc should not be this internal interface,
678 #. .\" but another internal interface that calls __acsafe_realloc if realloc
679 #. .\" was not overridden, and calls the overridden realloc with async
680 #. .\" cancel disabled. --lxoliva
681 #. .TP
682 #. .I heap
683 #. Functions marked with
684 #. .I heap
685 #. may call heap memory management functions from the
686 #. .BR malloc (3)/ free (3)
687 #. family of functions and are only as safe as those functions.
688 #. This note is thus equivalent to:
689 #. | AS-Unsafe lock | AC-Unsafe lock fd mem |
690 #. .\" @sampsafety{@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
691 #. .\"
692 #. .\" Check for cases that should have used plugin instead of or in
693 #. .\" addition to this. Then, after rechecking gettext, adjust i18n if
694 #. .\" needed.
695 #. .TP
696 #. .I dlopen
697 #. Functions marked with
698 #. .I dlopen
699 #. use the dynamic loader to load
700 #. shared libraries into the current execution image.
701 #. This involves opening files, mapping them into memory,
702 #. allocating additional memory, resolving symbols,
703 #. applying relocations and more,
704 #. all of this while holding internal dynamic loader locks.
705 #. The locks are enough for these functions to be AS-Unsafe and AC-Unsafe,
706 #. but other issues may arise.
707 #. At present this is a placeholder for all
708 #. potential safety issues raised by
709 #. .BR dlopen (3).
710 #. .\" dlopen runs init and fini sections of the module; does this mean
711 #. .\" dlopen always implies plugin?
712 #. .TP
713 #. .I plugin
714 #. Functions annotated with
715 #. .I plugin
716 #. may run code from plugins that
717 #. may be external to the GNU C Library.
718 #. Such plugin functions are assumed to be
719 #. MT-Safe, AS-Unsafe and AC-Unsafe.
720 #. Examples of such plugins are stack unwinding libraries,
721 #. name service switch (NSS) and character set conversion (iconv) back-ends.
722 #. Although the plugins mentioned as examples are all brought in by means
723 #. of dlopen, the
724 #. .I plugin
725 #. keyword does not imply any direct
726 #. involvement of the dynamic loader or the
727 #. .I libdl
728 #. interfaces,
729 #. those are covered by
730 #. .IR dlopen .
731 #. For example, if one function loads a module and finds the addresses
732 #. of some of its functions,
733 #. while another just calls those already-resolved functions,
734 #. the former will be marked with
735 #. .IR dlopen ,
736 #. whereas the latter will get the
737 #. .IR plugin .
738 #. When a single function takes all of these actions, then it gets both marks.
739 #. .TP
740 #. .I i18n
741 #. Functions marked with
742 #. .I i18n
743 #. may call internationalization
744 #. functions of the
745 #. .BR gettext (3)
746 #. family and will be only as safe as those
747 #. functions.
748 #. This note is thus equivalent to:
749 #. | MT-Safe env | AS-Unsafe corrupt heap dlopen | AC-Unsafe corrupt |
750 #. .\" @sampsafety{@mtsafe{@mtsenv{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascudlopen{}}@acunsafe{@acucorrupt{}}}
751 #. .TP
752 #. .I timer
753 #. Functions marked with
754 #. .I timer
755 #. use the
756 #. .BR alarm (3)
757 #. function or
758 #. similar to set a time-out for a system call or a long-running operation.
759 #. In a multi-threaded program, there is a risk that the time-out signal
760 #. will be delivered to a different thread,
761 #. thus failing to interrupt the intended thread.
762 #. Besides being MT-Unsafe, such functions are always
763 #. AS-Unsafe, because calling them in signal handlers may interfere with
764 #. timers set in the interrupted code, and AC-Unsafe,
765 #. because there is no safe way to guarantee an earlier timer
766 #. will be reset in case of asynchronous cancelation.
767 #. type: Plain text
768 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
769 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
770 msgid ""
771 "Other keywords that appear in safety notes are defined in subsequent "
772 "sections."
773 msgstr ""
774
775 #. type: SS
776 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
777 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
778 #, no-wrap
779 msgid "Conditionally safe features"
780 msgstr ""
781
782 #. type: Plain text
783 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
784 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
785 msgid ""
786 "For some features that make functions unsafe to call in certain contexts, "
787 "there are known ways to avoid the safety problem other than refraining from "
788 "calling the function altogether. The keywords that follow refer to such "
789 "features, and each of their definitions indicates how the whole program "
790 "needs to be constrained in order to remove the safety problem indicated by "
791 "the keyword. Only when all the reasons that make a function unsafe are "
792 "observed and addressed, by applying the documented constraints, does the "
793 "function become safe to call in a context."
794 msgstr ""
795
796 #. type: TP
797 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
798 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
799 #, no-wrap
800 msgid "I<init>"
801 msgstr ""
802
803 #. type: Plain text
804 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
805 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
806 msgid ""
807 "Functions marked with I<init> as an MT-Unsafe feature perform MT-Unsafe "
808 "initialization when they are first called."
809 msgstr ""
810
811 #
812 #
813 #
814 #
815 #
816 #. Functions marked with
817 #. .I init
818 #. as an AS-Unsafe or AC-Unsafe feature use the GNU C Library internal
819 #. .I libc_once
820 #. machinery or similar to initialize internal data structures.
821 #. If a signal handler interrupts such an initializer,
822 #. and calls any function that also performs
823 #. .I libc_once
824 #. initialization, it will deadlock if the thread library has been loaded.
825 #. Furthermore, if an initializer is partially complete before it is canceled
826 #. or interrupted by a signal whose handler requires the same initialization,
827 #. some or all of the initialization may be performed more than once,
828 #. leaking resources or even resulting in corrupt internal data.
829 #. Applications that need to call functions marked with
830 #. .I init
831 #. as an AS-Safety or AC-Unsafe feature should ensure
832 #. the initialization is performed
833 #. before configuring signal handlers or enabling cancelation,
834 #. so that the AS-Safety and AC-Safety issues related with
835 #. .I libc_once
836 #. do not arise.
837 #. .\" We may have to extend the annotations to cover conditions in which
838 #. .\" initialization may or may not occur, since an initial call in a safe
839 #. .\" context is no use if the initialization doesn't take place at that
840 #. .\" time: it doesn't remove the risk for later calls.
841 #. type: Plain text
842 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
843 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
844 msgid ""
845 "Calling such a function at least once in single-threaded mode removes this "
846 "specific cause for the function to be regarded as MT-Unsafe. If no other "
847 "cause for that remains, the function can then be safely called after other "
848 "threads are started."
849 msgstr ""
850
851 #. type: TP
852 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
853 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
854 #, no-wrap
855 msgid "I<race>"
856 msgstr ""
857
858 #
859 #
860 #
861 #
862 #
863 #
864 #
865 #. We consider access to objects passed as (indirect) arguments to
866 #. functions to be data race free.
867 #. The assurance of data race free objects
868 #. is the caller's responsibility.
869 #. We will not mark a function as MT-Unsafe or AS-Unsafe
870 #. if it misbehaves when users fail to take the measures required by
871 #. POSIX to avoid data races when dealing with such objects.
872 #. As a general rule, if a function is documented as reading from
873 #. an object passed (by reference) to it, or modifying it,
874 #. users ought to use memory synchronization primitives
875 #. to avoid data races just as they would should they perform
876 #. the accesses themselves rather than by calling the library function.
877 #. Standard I/O
878 #. .RI ( "FILE *" )
879 #. streams are the exception to the general rule,
880 #. in that POSIX mandates the library to guard against data races
881 #. in many functions that manipulate objects of this specific opaque type.
882 #. We regard this as a convenience provided to users,
883 #. rather than as a general requirement whose expectations
884 #. should extend to other types.
885 #. In order to remind users that guarding certain arguments is their
886 #. responsibility, we will annotate functions that take objects of certain
887 #. types as arguments.
888 #. We draw the line for objects passed by users as follows:
889 #. objects whose types are exposed to users,
890 #. and that users are expected to access directly,
891 #. such as memory buffers, strings,
892 #. and various user-visible structured types, do
893 #. .I not
894 #. give reason for functions to be annotated with
895 #. .IR race .
896 #. It would be noisy and redundant with the general requirement,
897 #. and not many would be surprised by the library's lack of internal
898 #. guards when accessing objects that can be accessed directly by users.
899 #. As for objects that are opaque or opaque-like,
900 #. in that they are to be manipulated only by passing them
901 #. to library functions (e.g.,
902 #. .IR FILE ,
903 #. .IR DIR ,
904 #. .IR obstack ,
905 #. .IR iconv_t ),
906 #. there might be additional expectations as to internal coordination
907 #. of access by the library.
908 #. We will annotate, with
909 #. .I race
910 #. followed by a colon and the argument name,
911 #. functions that take such objects but that do not take
912 #. care of synchronizing access to them by default.
913 #. For example,
914 #. .I FILE
915 #. stream
916 #. .I unlocked
917 #. functions
918 #. .RB ( unlocked_stdio (3))
919 #. will be annotated,
920 #. but those that perform implicit locking on
921 #. .I FILE
922 #. streams by default will not,
923 #. even though the implicit locking may be disabled on a per-stream basis.
924 #. In either case, we will not regard as MT-Unsafe functions that may
925 #. access user-supplied objects in unsafe ways should users fail to ensure
926 #. the accesses are well defined.
927 #. The notion prevails that users are expected to safeguard against
928 #. data races any user-supplied objects that the library accesses
929 #. on their behalf.
930 #. .\" The above describes @mtsrace; @mtasurace is described below.
931 #. This user responsibility does not apply, however,
932 #. to objects controlled by the library itself,
933 #. such as internal objects and static buffers used
934 #. to return values from certain calls.
935 #. When the library doesn't guard them against concurrent uses,
936 #. these cases are regarded as MT-Unsafe and AS-Unsafe (although the
937 #. .I race
938 #. mark under AS-Unsafe will be omitted
939 #. as redundant with the one under MT-Unsafe).
940 #. As in the case of user-exposed objects,
941 #. the mark may be followed by a colon and an identifier.
942 #. The identifier groups all functions that operate on a
943 #. certain unguarded object; users may avoid the MT-Safety issues related
944 #. with unguarded concurrent access to such internal objects by creating a
945 #. non-recursive mutex related with the identifier,
946 #. and always holding the mutex when calling any function marked
947 #. as racy on that identifier,
948 #. as they would have to should the identifier be
949 #. an object under user control.
950 #. The non-recursive mutex avoids the MT-Safety issue,
951 #. but it trades one AS-Safety issue for another,
952 #. so use in asynchronous signals remains undefined.
953 #. When the identifier relates to a static buffer used to hold return values,
954 #. the mutex must be held for as long as the buffer remains in use
955 #. by the caller.
956 #. Many functions that return pointers to static buffers offer reentrant
957 #. variants that store return values in caller-supplied buffers instead.
958 #. In some cases, such as
959 #. .BR tmpname (3),
960 #. the variant is chosen not by calling an alternate entry point,
961 #. but by passing a non-null pointer to the buffer in which the
962 #. returned values are to be stored.
963 #. These variants are generally preferable in multi-threaded programs,
964 #. although some of them are not MT-Safe because of other internal buffers,
965 #. also documented with
966 #. .I race
967 #. notes.
968 #. type: Plain text
969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
971 msgid ""
972 "Functions annotated with I<race> as an MT-Safety issue operate on objects in "
973 "ways that may cause data races or similar forms of destructive interference "
974 "out of concurrent execution. In some cases, the objects are passed to the "
975 "functions by users; in others, they are used by the functions to return "
976 "values to users; in others, they are not even exposed to users."
977 msgstr ""
978
979 #. type: TP
980 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
981 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
982 #, no-wrap
983 msgid "I<const>"
984 msgstr ""
985
986 #. and AS-Unsafe,
987 #. equally
988 #. and AS-Unsafe
989 #. and AS-Safe
990 #. type: Plain text
991 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
992 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
993 msgid ""
994 "Functions marked with I<const> as an MT-Safety issue non-atomically modify "
995 "internal objects that are better regarded as constant, because a substantial "
996 "portion of the GNU C Library accesses them without synchronization. Unlike "
997 "I<race>, which causes both readers and writers of internal objects to be "
998 "regarded as MT-Unsafe, this mark is applied to writers only. Writers remain "
999 "MT-Unsafe to call, but the then-mandatory constness of objects they modify "
1000 "enables readers to be regarded as MT-Safe (as long as no other reasons for "
1001 "them to be unsafe remain), since the lack of synchronization is not a "
1002 "problem when the objects are effectively constant."
1003 msgstr ""
1004
1005 #
1006 #. The non-recursive locking removes the MT-Safety problem,
1007 #. but it trades one AS-Safety problem for another,
1008 #. so use in asynchronous signals remains undefined.
1009 #. .\" But what if, instead of marking modifiers with const:id and readers
1010 #. .\" with just id, we marked writers with race:id and readers with ro:id?
1011 #. .\" Instead of having to define each instance of 'id', we'd have a
1012 #. .\" general pattern governing all such 'id's, wherein race:id would
1013 #. .\" suggest the need for an exclusive/write lock to make the function
1014 #. .\" safe, whereas ro:id would indicate 'id' is expected to be read-only,
1015 #. .\" but if any modifiers are called (while holding an exclusive lock),
1016 #. .\" then ro:id-marked functions ought to be guarded with a read lock for
1017 #. .\" safe operation. ro:env or ro:locale, for example, seems to convey
1018 #. .\" more clearly the expectations and the meaning, than just env or
1019 #. .\" locale.
1020 #. type: Plain text
1021 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1022 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1023 msgid ""
1024 "The identifier that follows the I<const> mark will appear by itself as a "
1025 "safety note in readers. Programs that wish to work around this safety "
1026 "issue, so as to call writers, may use a non-recursive read-write lock "
1027 "associated with the identifier, and guard I<all> calls to functions marked "
1028 "with I<const> followed by the identifier with a write lock, and I<all> calls "
1029 "to functions marked with the identifier by itself with a read lock."
1030 msgstr ""
1031
1032 #. type: TP
1033 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1034 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1035 #, no-wrap
1036 msgid "I<sig>"
1037 msgstr ""
1038
1039 #. (that implies an identical AS-Safety issue, omitted for brevity)
1040 #. type: Plain text
1041 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1042 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1043 msgid ""
1044 "Functions marked with I<sig> as a MT-Safety issue may temporarily install a "
1045 "signal handler for internal purposes, which may interfere with other uses of "
1046 "the signal, identified after a colon."
1047 msgstr ""
1048
1049 #
1050 #
1051 #
1052 #. There is no safe way to guarantee the original signal handler is
1053 #. restored in case of asynchronous cancelation,
1054 #. therefore so-marked functions are also AC-Unsafe.
1055 #. .\" fixme: at least deferred cancelation should get it right, and would
1056 #. .\" obviate the restoring bit below, and the qualifier above.
1057 #. Besides the measures recommended to work around the
1058 #. MT-Safety and AS-Safety problem,
1059 #. in order to avert the cancelation problem,
1060 #. disabling asynchronous cancelation
1061 #. .I and
1062 #. installing a cleanup handler to restore the signal to the desired state
1063 #. and to release the mutex are recommended.
1064 #. type: Plain text
1065 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1066 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1067 msgid ""
1068 "This safety problem can be worked around by ensuring that no other uses of "
1069 "the signal will take place for the duration of the call. Holding a non-"
1070 "recursive mutex while calling all functions that use the same temporary "
1071 "signal; blocking that signal before the call and resetting its handler "
1072 "afterwards is recommended."
1073 msgstr ""
1074
1075 #. type: TP
1076 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1077 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1078 #, no-wrap
1079 msgid "I<term>"
1080 msgstr ""
1081
1082 #. The same window enables changes made by asynchronous signals to be lost.
1083 #. These functions are also AS-Unsafe,
1084 #. but the corresponding mark is omitted as redundant.
1085 #. type: Plain text
1086 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1087 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1088 msgid ""
1089 "Functions marked with I<term> as an MT-Safety issue may change the terminal "
1090 "settings in the recommended way, namely: call B<tcgetattr>(3), modify some "
1091 "flags, and then call B<tcsetattr>(3), this creates a window in which changes "
1092 "made by other threads are lost. Thus, functions marked with I<term> are MT-"
1093 "Unsafe."
1094 msgstr ""
1095
1096 #
1097 #
1098 #
1099 #. Functions marked with
1100 #. .I term
1101 #. as an AC-Safety issue are supposed to
1102 #. restore terminal settings to their original state,
1103 #. after temporarily changing them, but they may fail to do so if canceled.
1104 #. .\" fixme: at least deferred cancelation should get it right, and would
1105 #. .\" obviate the restoring bit below, and the qualifier above.
1106 #. Besides the measures recommended to work around the
1107 #. MT-Safety and AS-Safety problem,
1108 #. in order to avert the cancelation problem,
1109 #. disabling asynchronous cancelation
1110 #. .I and
1111 #. installing a cleanup handler to
1112 #. restore the terminal settings to the original state and to release the
1113 #. mutex are recommended.
1114 #. type: Plain text
1115 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1116 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1117 msgid ""
1118 "It is thus advisable for applications using the terminal to avoid concurrent "
1119 "and reentrant interactions with it, by not using it in signal handlers or "
1120 "blocking signals that might use it, and holding a lock while calling these "
1121 "functions and interacting with the terminal. This lock should also be used "
1122 "for mutual exclusion with functions marked with I<race:tcattr(fd)>, where "
1123 "I<fd> is a file descriptor for the controlling terminal. The caller may use "
1124 "a single mutex for simplicity, or use one mutex per terminal, even if "
1125 "referenced by different file descriptors."
1126 msgstr ""
1127
1128 #. type: SS
1129 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1130 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1131 #, no-wrap
1132 msgid "Other safety remarks"
1133 msgstr ""
1134
1135 #. type: Plain text
1136 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1137 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1138 msgid ""
1139 "Additional keywords may be attached to functions, indicating features that "
1140 "do not make a function unsafe to call, but that may need to be taken into "
1141 "account in certain classes of programs:"
1142 msgstr ""
1143
1144 #. type: TP
1145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1147 #, no-wrap
1148 msgid "I<locale>"
1149 msgstr ""
1150
1151 #. type: Plain text
1152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1154 msgid ""
1155 "Functions annotated with I<locale> as an MT-Safety issue read from the "
1156 "locale object without any form of synchronization. Functions annotated with "
1157 "I<locale> called concurrently with locale changes may behave in ways that do "
1158 "not correspond to any of the locales active during their execution, but an "
1159 "unpredictable mix thereof."
1160 msgstr ""
1161
1162 #. or AS-Unsafe,
1163 #. Should the locking strategy suggested under @code{const} be used,
1164 #. failure to guard locale uses is not as fatal as data races in
1165 #. general: unguarded uses will @emph{not} follow dangling pointers or
1166 #. access uninitialized, unmapped or recycled memory. Each access will
1167 #. read from a consistent locale object that is or was active at some
1168 #. point during its execution. Without synchronization, however, it
1169 #. cannot even be assumed that, after a change in locale, earlier
1170 #. locales will no longer be used, even after the newly-chosen one is
1171 #. used in the thread. Nevertheless, even though unguarded reads from
1172 #. the locale will not violate type safety, functions that access the
1173 #. locale multiple times may invoke all sorts of undefined behavior
1174 #. because of the unexpected locale changes.
1175 #. type: Plain text
1176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1178 msgid ""
1179 "We do not mark these functions as MT-Unsafe, however, because functions that "
1180 "modify the locale object are marked with I<const:locale> and regarded as "
1181 "unsafe. Being unsafe, the latter are not to be called when multiple threads "
1182 "are running or asynchronous signals are enabled, and so the locale can be "
1183 "considered effectively constant in these contexts, which makes the former "
1184 "safe."
1185 msgstr ""
1186
1187 #. type: TP
1188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1190 #, no-wrap
1191 msgid "I<env>"
1192 msgstr ""
1193
1194 #. type: Plain text
1195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1197 msgid ""
1198 "Functions marked with I<env> as an MT-Safety issue access the environment "
1199 "with B<getenv>(3) or similar, without any guards to ensure safety in the "
1200 "presence of concurrent modifications."
1201 msgstr ""
1202
1203 #. or AS-Unsafe,
1204 #. type: Plain text
1205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1207 msgid ""
1208 "We do not mark these functions as MT-Unsafe, however, because functions that "
1209 "modify the environment are all marked with I<const:env> and regarded as "
1210 "unsafe. Being unsafe, the latter are not to be called when multiple threads "
1211 "are running or asynchronous signals are enabled, and so the environment can "
1212 "be considered effectively constant in these contexts, which makes the former "
1213 "safe."
1214 msgstr ""
1215
1216 #. type: TP
1217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1219 #, no-wrap
1220 msgid "I<hostid>"
1221 msgstr ""
1222
1223 #. type: Plain text
1224 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
1225 #: opensuse-leap-16-1 opensuse-tumbleweed
1226 msgid ""
1227 "Functions marked with I<hostid> as an MT-Safety issue read from the system-"
1228 "wide data structures that hold the \"host ID\" of the machine. These data "
1229 "structures cannot generally be modified atomically. Since it is expected "
1230 "that the \"host ID\" will not normally change, the function that reads from "
1231 "it (B<gethostid>(3)) is regarded as safe, whereas the function that "
1232 "modifies it (B<sethostid>(3)) is marked with I<const:hostid>, indicating it "
1233 "may require special care if it is to be called. In this specific case, the "
1234 "special care amounts to system-wide (not merely intra-process) coordination."
1235 msgstr ""
1236
1237 #. type: TP
1238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1240 #, no-wrap
1241 msgid "I<sigintr>"
1242 msgstr ""
1243
1244 #. type: Plain text
1245 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1246 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1247 msgid ""
1248 "Functions marked with I<sigintr> as an MT-Safety issue access the GNU C "
1249 "Library I<_sigintr> internal data structure without any guards to ensure "
1250 "safety in the presence of concurrent modifications."
1251 msgstr ""
1252
1253 #
1254 #
1255 #
1256 #
1257 #
1258 #. or AS-Unsafe,
1259 #. .TP
1260 #. .I fd
1261 #. Functions annotated with
1262 #. .I fd
1263 #. as an AC-Safety issue may leak file
1264 #. descriptors if asynchronous thread cancelation interrupts their
1265 #. execution.
1266 #. Functions that allocate or deallocate file descriptors will generally be
1267 #. marked as such.
1268 #. Even if they attempted to protect the file descriptor
1269 #. allocation and deallocation with cleanup regions,
1270 #. allocating a new descriptor and storing its number where the cleanup region
1271 #. could release it cannot be performed as a single atomic operation.
1272 #. Similarly,
1273 #. releasing the descriptor and taking it out of the data structure
1274 #. normally responsible for releasing it cannot be performed atomically.
1275 #. There will always be a window in which the descriptor cannot be released
1276 #. because it was not stored in the cleanup handler argument yet,
1277 #. or it was already taken out before releasing it.
1278 #. .\" It cannot be taken out after release:
1279 #. an open descriptor could mean either that the descriptor still
1280 #. has to be closed,
1281 #. or that it already did so but the descriptor was
1282 #. reallocated by another thread or signal handler.
1283 #. Such leaks could be internally avoided, with some performance penalty,
1284 #. by temporarily disabling asynchronous thread cancelation.
1285 #. However,
1286 #. since callers of allocation or deallocation functions would have to do
1287 #. this themselves, to avoid the same sort of leak in their own layer,
1288 #. it makes more sense for the library to assume they are taking care of it
1289 #. than to impose a performance penalty that is redundant when the problem
1290 #. is solved in upper layers, and insufficient when it is not.
1291 #. This remark by itself does not cause a function to be regarded as
1292 #. AC-Unsafe.
1293 #. However, cumulative effects of such leaks may pose a
1294 #. problem for some programs.
1295 #. If this is the case,
1296 #. suspending asynchronous cancelation for the duration of calls
1297 #. to such functions is recommended.
1298 #. .TP
1299 #. .I mem
1300 #. Functions annotated with
1301 #. .I mem
1302 #. as an AC-Safety issue may leak
1303 #. memory if asynchronous thread cancelation interrupts their execution.
1304 #. The problem is similar to that of file descriptors: there is no atomic
1305 #. interface to allocate memory and store its address in the argument to a
1306 #. cleanup handler,
1307 #. or to release it and remove its address from that argument,
1308 #. without at least temporarily disabling asynchronous cancelation,
1309 #. which these functions do not do.
1310 #. This remark does not by itself cause a function to be regarded as
1311 #. generally AC-Unsafe.
1312 #. However, cumulative effects of such leaks may be
1313 #. severe enough for some programs that disabling asynchronous cancelation
1314 #. for the duration of calls to such functions may be required.
1315 #. type: Plain text
1316 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1317 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1318 msgid ""
1319 "We do not mark these functions as MT-Unsafe, however, because functions that "
1320 "modify this data structure are all marked with I<const:sigintr> and regarded "
1321 "as unsafe. Being unsafe, the latter are not to be called when multiple "
1322 "threads are running or asynchronous signals are enabled, and so the data "
1323 "structure can be considered effectively constant in these contexts, which "
1324 "makes the former safe."
1325 msgstr ""
1326
1327 #. type: TP
1328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1330 #, no-wrap
1331 msgid "I<cwd>"
1332 msgstr ""
1333
1334 #. type: Plain text
1335 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1336 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1337 msgid ""
1338 "Functions marked with I<cwd> as an MT-Safety issue may temporarily change "
1339 "the current working directory during their execution, which may cause "
1340 "relative pathnames to be resolved in unexpected ways in other threads or "
1341 "within asynchronous signal or cancelation handlers."
1342 msgstr ""
1343
1344 #
1345 #. or AS-Unsafe,
1346 #. .TP
1347 #. .I !posix
1348 #. This remark, as an MT-Safety, AS-Safety or AC-Safety
1349 #. note to a function,
1350 #. indicates the safety status of the function is known to differ
1351 #. from the specified status in the POSIX standard.
1352 #. For example, POSIX does not require a function to be Safe,
1353 #. but our implementation is, or vice-versa.
1354 #. For the time being, the absence of this remark does not imply the safety
1355 #. properties we documented are identical to those mandated by POSIX for
1356 #. the corresponding functions.
1357 #. type: Plain text
1358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1360 msgid ""
1361 "This is not enough of a reason to mark so-marked functions as MT-Unsafe, but "
1362 "when this behavior is optional (e.g., B<nftw>(3) with B<FTW_CHDIR>), "
1363 "avoiding the option may be a good alternative to using full pathnames or "
1364 "file descriptor-relative (e.g., B<openat>(2)) system calls."
1365 msgstr ""
1366
1367 #. type: TP
1368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1370 #, no-wrap
1371 msgid "I<:identifier>"
1372 msgstr ""
1373
1374 #. type: Plain text
1375 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1376 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1377 msgid ""
1378 "Annotations may sometimes be followed by identifiers, intended to group "
1379 "several functions that, for example, access the data structures in an unsafe "
1380 "way, as in I<race> and I<const>, or to provide more specific information, "
1381 "such as naming a signal in a function marked with I<sig>. It is envisioned "
1382 "that it may be applied to I<lock> and I<corrupt> as well in the future."
1383 msgstr ""
1384
1385 #. type: Plain text
1386 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1387 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1388 msgid ""
1389 "In most cases, the identifier will name a set of functions, but it may name "
1390 "global objects or function arguments, or identifiable properties or logical "
1391 "components associated with them, with a notation such as, for example, "
1392 "I<:buf(arg)> to denote a buffer associated with the argument I<arg>, or "
1393 "I<:tcattr(fd)> to denote the terminal attributes of a file descriptor I<fd>."
1394 msgstr ""
1395
1396 #. type: Plain text
1397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1399 msgid ""
1400 "The most common use for identifiers is to provide logical groups of "
1401 "functions and arguments that need to be protected by the same "
1402 "synchronization primitive in order to ensure safe operation in a given "
1403 "context."
1404 msgstr ""
1405
1406 #. type: TP
1407 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1408 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1409 #, no-wrap
1410 msgid "I</condition>"
1411 msgstr ""
1412
1413 #. Such conditions as
1414 #. .I /hurd
1415 #. or
1416 #. .I /!linux!bsd
1417 #. indicate the preceding marker only
1418 #. applies when the underlying kernel is the HURD,
1419 #. or when it is neither Linux nor a BSD kernel, respectively.
1420 #. type: Plain text
1421 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1422 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1423 msgid ""
1424 "Some safety annotations may be conditional, in that they only apply if a "
1425 "boolean expression involving arguments, global variables or even the "
1426 "underlying kernel evaluates to true. For example, I</!ps> and I</"
1427 "one_per_line> indicate the preceding marker only applies when argument I<ps> "
1428 "is NULL, or global variable I<one_per_line> is nonzero."
1429 msgstr ""
1430
1431 #. type: Plain text
1432 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1433 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1434 msgid ""
1435 "When all marks that render a function unsafe are adorned with such "
1436 "conditions, and none of the named conditions hold, then the function can be "
1437 "regarded as safe."
1438 msgstr ""
1439
1440 #. type: SH
1441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1443 #, no-wrap
1444 msgid "SEE ALSO"
1445 msgstr ""
1446
1447 #. type: Plain text
1448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1450 msgid "B<pthreads>(7), B<signal-safety>(7)"
1451 msgstr ""
1452
1453 #. type: TH
1454 #: debian-trixie
1455 #, no-wrap
1456 msgid "2024-05-02"
1457 msgstr ""
1458
1459 #. type: TH
1460 #: debian-trixie
1461 #, no-wrap
1462 msgid "Linux man-pages 6.9.1"
1463 msgstr ""
1464
1465 #. type: Plain text
1466 #: debian-trixie
1467 msgid ""
1468 "The function marked with I<hostid> as an MT-Safety issue reads from the "
1469 "system-wide data structures that hold the \"host ID\" of the machine. These "
1470 "data structures cannot generally be modified atomically. Since it is "
1471 "expected that the \"host ID\" will not normally change, the function that "
1472 "reads from it (B<gethostid>(3)) is regarded as safe, whereas the function "
1473 "that modifies it (B<sethostid>(3)) is marked with I<const:hostid>, "
1474 "indicating it may require special care if it is to be called. In this "
1475 "specific case, the special care amounts to system-wide (not merely intra-"
1476 "process) coordination."
1477 msgstr ""
1478
1479 #. type: TH
1480 #: fedora-44 fedora-rawhide
1481 #, no-wrap
1482 msgid "2024-11-17"
1483 msgstr ""
1484
1485 #. type: TH
1486 #: fedora-44 fedora-rawhide
1487 #, no-wrap
1488 msgid "Linux man-pages 6.13"
1489 msgstr ""
1490
1491 #. type: TH
1492 #: mageia-cauldron
1493 #, no-wrap
1494 msgid "Linux man-pages 6.17"
1495 msgstr ""
1496
1497 #. type: TH
1498 #: opensuse-leap-16-1 opensuse-tumbleweed
1499 #, no-wrap
1500 msgid "Linux man-pages (unreleased)"
1501 msgstr ""