Debian Codegraph @

po/ar/man3/pthread_cancel.3.po

raw
1 # Arabic translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # زايد السعيدي <[email protected]>, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.30.2\n"
8 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
9 "PO-Revision-Date: 2026-06-02 19:38+0400\n"
10 "Last-Translator: Zayed Al-Saidi <[email protected]>\n"
11 "Language-Team: Arabic <[email protected]>\n"
12 "Language: ar\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
17 "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
18 "X-Generator: Lokalize 23.08.5\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "pthread_cancel"
25 msgstr "pthread_cancel"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2025-09-21"
32 msgstr "21 سبتمبر 2025"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "صفحات دليل لينكس 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "الاسم"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid "pthread_cancel - send a cancelation request to a thread"
51 msgstr "pthread_cancel - إرسال طلب إلغاء إلى خيط"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "LIBRARY"
58 msgstr "المكتبة"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
64 msgstr "مكتبة مسالك POSIX (I<libpthread>،\\ I<-lpthread>)"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "SYNOPSIS"
71 msgstr "موجز"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>pthread.hE<gt>>\n"
78 msgstr "B<#include E<lt>pthread.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
85 msgstr "B<int pthread_cancel(pthread_t >I<thread>B<);>\n"
86
87 #. type: SH
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 #, no-wrap
91 msgid "DESCRIPTION"
92 msgstr "الوصف"
93
94 #. type: Plain text
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 msgid ""
98 "The B<pthread_cancel>() function sends a cancelation request to the thread "
99 "I<thread>. Whether and when the target thread reacts to the cancelation "
100 "request depends on two attributes that are under the control of that thread: "
101 "its cancelability I<state> and I<type>."
102 msgstr ""
103 "ترسل الدالة B<pthread_cancel>() طلب إلغاء إلى الخيط I<thread>. يعتمد ما إذا "
104 "كان الخيط الهدف يستجيب لطلب الإلغاء ومتى يستجيب على سمتين تحت سيطرة ذلك "
105 "الخيط: I<حالة> القابلية للإلغاء و I<نوعها>."
106
107 #. type: Plain text
108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
110 msgid ""
111 "A thread's cancelability state, determined by B<pthread_setcancelstate>(3), "
112 "can be I<enabled> (the default for new threads) or I<disabled>. If a thread "
113 "has disabled cancelation, then a cancelation request remains queued until "
114 "the thread enables cancelation. If a thread has enabled cancelation, then "
115 "its cancelability type determines when cancelation occurs."
116 msgstr ""
117 "حالة قابلية الخيط للإلغاء، المحددة بواسطة B<pthread_setcancelstate>(3)، يمكن "
118 "أن تكون I<مُفعّلة> (المبدئي للخيوط الجديدة) أو I<مُعطّلة>. إذا عطّل خيط الإلغاء، "
119 "يبقى طلب الإلغاء في قائمة الانتظار حتى يُفعّل الخيط الإلغاء. إذا فعّل خيط "
120 "الإلغاء، يحدد نوع قابلية الإلغاء متى يحدث الإلغاء."
121
122 #. type: Plain text
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 msgid ""
126 "A thread's cancelation type, determined by B<pthread_setcanceltype>(3), may "
127 "be either I<asynchronous> or I<deferred> (the default for new threads). "
128 "Asynchronous cancelability means that the thread can be canceled at any time "
129 "(usually immediately, but the system does not guarantee this). Deferred "
130 "cancelability means that cancelation will be delayed until the thread next "
131 "calls a function that is a I<cancelation point>. A list of functions that "
132 "are or may be cancelation points is provided in B<pthreads>(7)."
133 msgstr ""
134 "نوع إلغاء الخيط، المحدد بواسطة B<pthread_setcanceltype>(3)، يمكن أن يكون إما "
135 "I<غير متزامن> أو I<مؤجل> (المبدئي للخيوط الجديدة). تعني قابلية الإلغاء غير "
136 "المتزامنة أنه يمكن إلغاء الخيط في أي وقت (عادةً فورًا، لكن النظام لا يضمن "
137 "ذلك). تعني قابلية الإلغاء المؤجلة أن الإلغاء سيُؤجل حتى يستدعي الخيط دالة هي "
138 "I<نقطة إلغاء>. تُقدم قائمة بالدوال التي هي أو قد تكون نقاط إلغاء في "
139 "B<pthreads>(7)."
140
141 #. type: Plain text
142 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
143 #: opensuse-leap-16-1 opensuse-tumbleweed
144 msgid ""
145 "When a cancelation request is acted on, the following steps occur for "
146 "I<thread> (in this order):"
147 msgstr ""
148 "عند تنفيذ طلب إلغاء، تحدث الخطوات التالية للخيط I<thread> (بهذا الترتيب):"
149
150 #. type: IP
151 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
152 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
153 #, no-wrap
154 msgid "(1)"
155 msgstr "(1)"
156
157 #. type: Plain text
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 msgid ""
161 "Cancelation clean-up handlers are popped (in the reverse of the order in "
162 "which they were pushed) and called. (See B<pthread_cleanup_push>(3).)"
163 msgstr ""
164 "تُفرغ معالجات التنظيف للإلغاء (بترتيب عكسي لترتيب دفعها) وتُستدعى. (انظر "
165 "B<pthread_cleanup_push>(3).)"
166
167 #. type: IP
168 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
169 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
170 #, no-wrap
171 msgid "(2)"
172 msgstr "(2)"
173
174 #. type: Plain text
175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
177 msgid ""
178 "Thread-specific data destructors are called, in an unspecified order. (See "
179 "B<pthread_key_create>(3).)"
180 msgstr ""
181 "تُستدعى مدمرات البيانات الخاصة بالخيط، بترتيب غير محدد. (انظر "
182 "B<pthread_key_create>(3).)"
183
184 #. type: IP
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 #, no-wrap
188 msgid "(3)"
189 msgstr "(3)"
190
191 #. type: Plain text
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 msgid "The thread is terminated. (See B<pthread_exit>(3).)"
195 msgstr "يُنهى الخيط. (انظر B<pthread_exit>(3).)"
196
197 #. type: Plain text
198 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
199 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
200 msgid ""
201 "The above steps happen asynchronously with respect to the "
202 "B<pthread_cancel>() call; the return status of B<pthread_cancel>() merely "
203 "informs the caller whether the cancelation request was successfully queued."
204 msgstr ""
205 "تحدث الخطوات أعلاه بشكل غير متزامن بالنسبة لاستدعاء B<pthread_cancel>()؛ "
206 "يُعلم حالة الإرجاع لـ B<pthread_cancel>() المتصل فقط ما إذا كان طلب الإلغاء "
207 "قد وُضع في قائمة الانتظار بنجاح."
208
209 #. type: Plain text
210 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
211 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
212 msgid ""
213 "After a canceled thread has terminated, a join with that thread using "
214 "B<pthread_join>(3) obtains B<PTHREAD_CANCELED> as the thread's exit "
215 "status. (Joining with a thread is the only way to know that cancelation has "
216 "completed.)"
217 msgstr ""
218 "بعد إنهاء خيط مُلغى، يحصل الانضمام إلى ذلك الخيط باستخدام B<pthread_join>(3) "
219 "على B<PTHREAD_CANCELED> كحالة خروج الخيط. (الانضمام إلى خيط هو الطريقة "
220 "الوحيدة لمعرفة أن الإلغاء قد اكتمل.)"
221
222 #. type: SH
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 #, no-wrap
226 msgid "RETURN VALUE"
227 msgstr "قيمة الإرجاع"
228
229 #. type: Plain text
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 msgid ""
233 "On success, B<pthread_cancel>() returns 0; on error, it returns a nonzero "
234 "error number."
235 msgstr ""
236 "عند النجاح، تُرجع B<pthread_cancel>() 0؛ عند الخطأ، تُرجع رقم خطأ غير صفري."
237
238 #. type: SH
239 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
240 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
241 #, no-wrap
242 msgid "ERRORS"
243 msgstr "الأخطاء"
244
245 #. type: TP
246 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
247 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
248 #, no-wrap
249 msgid "B<ESRCH>"
250 msgstr "B<ESRCH>"
251
252 #. type: Plain text
253 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
254 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
255 msgid "No thread with the ID I<thread> could be found."
256 msgstr "تعذر العثور على أي خيط بالمعرف I<thread>."
257
258 #. type: SH
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 #, no-wrap
262 msgid "ATTRIBUTES"
263 msgstr "السمات"
264
265 #. type: Plain text
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 msgid ""
269 "For an explanation of the terms used in this section, see B<attributes>(7)."
270 msgstr ""
271 "للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)."
272
273 #. type: tbl table
274 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
275 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
276 #, no-wrap
277 msgid "Interface"
278 msgstr "الواجهة"
279
280 #. type: tbl table
281 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
282 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
283 #, no-wrap
284 msgid "Attribute"
285 msgstr "السمة"
286
287 #. type: tbl table
288 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
289 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
290 #, no-wrap
291 msgid "Value"
292 msgstr "القيمة"
293
294 #. type: tbl table
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 #, no-wrap
298 msgid ".na\n"
299 msgstr ".na\n"
300
301 #. type: tbl table
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 #, no-wrap
305 msgid ".nh\n"
306 msgstr ".nh\n"
307
308 #. type: tbl table
309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
311 #, no-wrap
312 msgid "B<pthread_cancel>()"
313 msgstr "B<pthread_cancel>()"
314
315 #. type: tbl table
316 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
317 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
318 #, no-wrap
319 msgid "Thread safety"
320 msgstr "سلامة الخيوط"
321
322 #. type: tbl table
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 #, no-wrap
326 msgid "MT-Safe"
327 msgstr "MT-Safe"
328
329 #. type: SH
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 #, no-wrap
333 msgid "VERSIONS"
334 msgstr "الإصدارات"
335
336 #. type: Plain text
337 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
338 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
339 msgid ""
340 "On Linux, cancelation is implemented using signals. Under the NPTL "
341 "threading implementation, the first real-time signal (i.e., signal 32) is "
342 "used for this purpose. On LinuxThreads, the second real-time signal is "
343 "used, if real-time signals are available, otherwise B<SIGUSR2> is used."
344 msgstr ""
345 "في لينكس، يُنفذ الإلغاء باستخدام الإشارات. تحت تنفيذ الخيوط NPTL، تُستخدم أول "
346 "إشارة زمن حقيقي (أي الإشارة 32) لهذا الغرض. في LinuxThreads، تُستخدم ثاني "
347 "إشارة زمن حقيقي، إذا كانت الإشارات الزمن الحقيقي متاحة، وإلا تُستخدم "
348 "B<SIGUSR2>."
349
350 #. type: SH
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "STANDARDS"
355 msgstr "المعايير"
356
357 #. type: Plain text
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 msgid "POSIX.1-2008."
361 msgstr "POSIX.1-2008."
362
363 #. type: SH
364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
366 #, no-wrap
367 msgid "HISTORY"
368 msgstr "التاريخ"
369
370 #. type: Plain text
371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
373 msgid "glibc 2.0 POSIX.1-2001."
374 msgstr "glibc 2.0 POSIX.1-2001."
375
376 #. type: SH
377 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
378 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
379 #, no-wrap
380 msgid "EXAMPLES"
381 msgstr "أمثلة"
382
383 #. type: Plain text
384 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
385 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
386 msgid ""
387 "The program below creates a thread and then cancels it. The main thread "
388 "joins with the canceled thread to check that its exit status was "
389 "B<PTHREAD_CANCELED>. The following shell session shows what happens when we "
390 "run the program:"
391 msgstr ""
392 "ينشئ البرنامج أدناه خيطًا ثم يلغيه. ينضم الخيط الرئيسي إلى الخيط المُلغى "
393 "للتحقق من أن حالة خروجه كانت B<PTHREAD_CANCELED>. تُظهر جلسة الصدفة التالية "
394 "ما يحدث عند تشغيل البرنامج:"
395
396 #. type: Plain text
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 #, no-wrap
400 msgid ""
401 "$ ./a.out\n"
402 "thread_func(): started; cancelation disabled\n"
403 "main(): sending cancelation request\n"
404 "thread_func(): about to enable cancelation\n"
405 "main(): thread was canceled\n"
406 msgstr ""
407 "$ ./a.out\n"
408 "thread_func(): started; cancelation disabled\n"
409 "main(): sending cancelation request\n"
410 "thread_func(): about to enable cancelation\n"
411 "main(): thread was canceled\n"
412
413 #. type: SS
414 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
415 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
416 #, no-wrap
417 msgid "Program source"
418 msgstr "مصدر البرنامج"
419
420 #. type: Plain text
421 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
422 #: opensuse-tumbleweed
423 #, no-wrap
424 msgid ""
425 "#include E<lt>err.hE<gt>\n"
426 "#include E<lt>pthread.hE<gt>\n"
427 "#include E<lt>stdio.hE<gt>\n"
428 "#include E<lt>stdlib.hE<gt>\n"
429 "#include E<lt>unistd.hE<gt>\n"
430 "\\&\n"
431 "static void *\n"
432 "thread_func(void *ignored_argument)\n"
433 "{\n"
434 " int s;\n"
435 "\\&\n"
436 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
437 " immediately react to a cancelation request. */\n"
438 "\\&\n"
439 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
440 " if (s != 0)\n"
441 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
442 "\\&\n"
443 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
444 " sleep(5);\n"
445 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
446 "\\&\n"
447 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
448 " if (s != 0)\n"
449 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
450 "\\&\n"
451 " /* sleep() is a cancelation point. */\n"
452 "\\&\n"
453 " sleep(1000); /* Should get canceled while we sleep */\n"
454 "\\&\n"
455 " /* Should never get here. */\n"
456 "\\&\n"
457 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
458 " return NULL;\n"
459 "}\n"
460 "\\&\n"
461 "int\n"
462 "main(void)\n"
463 "{\n"
464 " pthread_t thr;\n"
465 " void *res;\n"
466 " int s;\n"
467 "\\&\n"
468 " /* Start a thread and then send it a cancelation request. */\n"
469 "\\&\n"
470 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
471 " if (s != 0)\n"
472 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
473 "\\&\n"
474 " sleep(2); /* Give thread a chance to get started */\n"
475 "\\&\n"
476 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
477 " s = pthread_cancel(thr);\n"
478 " if (s != 0)\n"
479 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
480 "\\&\n"
481 " /* Join with thread to see what its exit status was. */\n"
482 "\\&\n"
483 " s = pthread_join(thr, &res);\n"
484 " if (s != 0)\n"
485 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
486 "\\&\n"
487 " if (res == PTHREAD_CANCELED)\n"
488 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
489 " else\n"
490 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
491 " __func__);\n"
492 " exit(EXIT_SUCCESS);\n"
493 "}\n"
494 msgstr ""
495 "#include E<lt>err.hE<gt>\n"
496 "#include E<lt>pthread.hE<gt>\n"
497 "#include E<lt>stdio.hE<gt>\n"
498 "#include E<lt>stdlib.hE<gt>\n"
499 "#include E<lt>unistd.hE<gt>\n"
500 "\\&\n"
501 "static void *\n"
502 "thread_func(void *ignored_argument)\n"
503 "{\n"
504 " int s;\n"
505 "\\&\n"
506 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
507 " immediately react to a cancelation request. */\n"
508 "\\&\n"
509 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
510 " if (s != 0)\n"
511 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
512 "\\&\n"
513 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
514 " sleep(5);\n"
515 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
516 "\\&\n"
517 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
518 " if (s != 0)\n"
519 " errc(EXIT_FAILURE, s, \"pthread_setcancelstate\");\n"
520 "\\&\n"
521 " /* sleep() is a cancelation point. */\n"
522 "\\&\n"
523 " sleep(1000); /* Should get canceled while we sleep */\n"
524 "\\&\n"
525 " /* Should never get here. */\n"
526 "\\&\n"
527 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
528 " return NULL;\n"
529 "}\n"
530 "\\&\n"
531 "int\n"
532 "main(void)\n"
533 "{\n"
534 " pthread_t thr;\n"
535 " void *res;\n"
536 " int s;\n"
537 "\\&\n"
538 " /* Start a thread and then send it a cancelation request. */\n"
539 "\\&\n"
540 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
541 " if (s != 0)\n"
542 " errc(EXIT_FAILURE, s, \"pthread_create\");\n"
543 "\\&\n"
544 " sleep(2); /* Give thread a chance to get started */\n"
545 "\\&\n"
546 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
547 " s = pthread_cancel(thr);\n"
548 " if (s != 0)\n"
549 " errc(EXIT_FAILURE, s, \"pthread_cancel\");\n"
550 "\\&\n"
551 " /* Join with thread to see what its exit status was. */\n"
552 "\\&\n"
553 " s = pthread_join(thr, &res);\n"
554 " if (s != 0)\n"
555 " errc(EXIT_FAILURE, s, \"pthread_join\");\n"
556 "\\&\n"
557 " if (res == PTHREAD_CANCELED)\n"
558 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
559 " else\n"
560 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
561 " __func__);\n"
562 " exit(EXIT_SUCCESS);\n"
563 "}\n"
564
565 #. SRC END
566 #. type: SH
567 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
568 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
569 #, no-wrap
570 msgid "SEE ALSO"
571 msgstr "انظر أيضًا"
572
573 #. type: Plain text
574 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
575 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
576 msgid ""
577 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
578 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
579 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
580 msgstr ""
581 "B<pthread_cleanup_push>(3), B<pthread_create>(3), B<pthread_exit>(3), "
582 "B<pthread_join>(3), B<pthread_key_create>(3), B<pthread_setcancelstate>(3), "
583 "B<pthread_setcanceltype>(3), B<pthread_testcancel>(3), B<pthreads>(7)"
584
585 #. type: TH
586 #: debian-trixie
587 #, no-wrap
588 msgid "2024-06-15"
589 msgstr "15 يونيو 2024"
590
591 #. type: TH
592 #: debian-trixie
593 #, no-wrap
594 msgid "Linux man-pages 6.9.1"
595 msgstr "صفحات دليل لينكس 6.9.1"
596
597 #. type: Plain text
598 #: debian-trixie
599 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
600 msgstr "مكتبة مسالك POSIX (I<libpthread>، I<-lpthread>)"
601
602 #. type: Plain text
603 #: debian-trixie
604 msgid ""
605 "When a cancelation requested is acted on, the following steps occur for "
606 "I<thread> (in this order):"
607 msgstr ""
608 "عند تنفيذ طلب إلغاء، تحدث الخطوات التالية للخيط I<thread> (بهذا الترتيب):"
609
610 #. type: Plain text
611 #: debian-trixie fedora-44 fedora-rawhide
612 #, no-wrap
613 msgid ""
614 "#include E<lt>errno.hE<gt>\n"
615 "#include E<lt>pthread.hE<gt>\n"
616 "#include E<lt>stdio.hE<gt>\n"
617 "#include E<lt>stdlib.hE<gt>\n"
618 "#include E<lt>unistd.hE<gt>\n"
619 "\\&\n"
620 "#define handle_error_en(en, msg) \\[rs]\n"
621 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
622 "\\&\n"
623 "static void *\n"
624 "thread_func(void *ignored_argument)\n"
625 "{\n"
626 " int s;\n"
627 "\\&\n"
628 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
629 " immediately react to a cancelation request. */\n"
630 "\\&\n"
631 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
632 " if (s != 0)\n"
633 " handle_error_en(s, \"pthread_setcancelstate\");\n"
634 "\\&\n"
635 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
636 " sleep(5);\n"
637 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
638 "\\&\n"
639 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
640 " if (s != 0)\n"
641 " handle_error_en(s, \"pthread_setcancelstate\");\n"
642 "\\&\n"
643 " /* sleep() is a cancelation point. */\n"
644 "\\&\n"
645 " sleep(1000); /* Should get canceled while we sleep */\n"
646 "\\&\n"
647 " /* Should never get here. */\n"
648 "\\&\n"
649 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
650 " return NULL;\n"
651 "}\n"
652 "\\&\n"
653 "int\n"
654 "main(void)\n"
655 "{\n"
656 " pthread_t thr;\n"
657 " void *res;\n"
658 " int s;\n"
659 "\\&\n"
660 " /* Start a thread and then send it a cancelation request. */\n"
661 "\\&\n"
662 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
663 " if (s != 0)\n"
664 " handle_error_en(s, \"pthread_create\");\n"
665 "\\&\n"
666 " sleep(2); /* Give thread a chance to get started */\n"
667 "\\&\n"
668 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
669 " s = pthread_cancel(thr);\n"
670 " if (s != 0)\n"
671 " handle_error_en(s, \"pthread_cancel\");\n"
672 "\\&\n"
673 " /* Join with thread to see what its exit status was. */\n"
674 "\\&\n"
675 " s = pthread_join(thr, &res);\n"
676 " if (s != 0)\n"
677 " handle_error_en(s, \"pthread_join\");\n"
678 "\\&\n"
679 " if (res == PTHREAD_CANCELED)\n"
680 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
681 " else\n"
682 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
683 " __func__);\n"
684 " exit(EXIT_SUCCESS);\n"
685 "}\n"
686 msgstr ""
687 "#include E<lt>errno.hE<gt>\n"
688 "#include E<lt>pthread.hE<gt>\n"
689 "#include E<lt>stdio.hE<gt>\n"
690 "#include E<lt>stdlib.hE<gt>\n"
691 "#include E<lt>unistd.hE<gt>\n"
692 "\\&\n"
693 "#define handle_error_en(en, msg) \\[rs]\n"
694 " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n"
695 "\\&\n"
696 "static void *\n"
697 "thread_func(void *ignored_argument)\n"
698 "{\n"
699 " int s;\n"
700 "\\&\n"
701 " /* Disable cancelation for a while, so that we don\\[aq]t\n"
702 " immediately react to a cancelation request. */\n"
703 "\\&\n"
704 " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n"
705 " if (s != 0)\n"
706 " handle_error_en(s, \"pthread_setcancelstate\");\n"
707 "\\&\n"
708 " printf(\"%s(): started; cancelation disabled\\[rs]n\", __func__);\n"
709 " sleep(5);\n"
710 " printf(\"%s(): about to enable cancelation\\[rs]n\", __func__);\n"
711 "\\&\n"
712 " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n"
713 " if (s != 0)\n"
714 " handle_error_en(s, \"pthread_setcancelstate\");\n"
715 "\\&\n"
716 " /* sleep() is a cancelation point. */\n"
717 "\\&\n"
718 " sleep(1000); /* Should get canceled while we sleep */\n"
719 "\\&\n"
720 " /* Should never get here. */\n"
721 "\\&\n"
722 " printf(\"%s(): not canceled!\\[rs]n\", __func__);\n"
723 " return NULL;\n"
724 "}\n"
725 "\\&\n"
726 "int\n"
727 "main(void)\n"
728 "{\n"
729 " pthread_t thr;\n"
730 " void *res;\n"
731 " int s;\n"
732 "\\&\n"
733 " /* Start a thread and then send it a cancelation request. */\n"
734 "\\&\n"
735 " s = pthread_create(&thr, NULL, &thread_func, NULL);\n"
736 " if (s != 0)\n"
737 " handle_error_en(s, \"pthread_create\");\n"
738 "\\&\n"
739 " sleep(2); /* Give thread a chance to get started */\n"
740 "\\&\n"
741 " printf(\"%s(): sending cancelation request\\[rs]n\", __func__);\n"
742 " s = pthread_cancel(thr);\n"
743 " if (s != 0)\n"
744 " handle_error_en(s, \"pthread_cancel\");\n"
745 "\\&\n"
746 " /* Join with thread to see what its exit status was. */\n"
747 "\\&\n"
748 " s = pthread_join(thr, &res);\n"
749 " if (s != 0)\n"
750 " handle_error_en(s, \"pthread_join\");\n"
751 "\\&\n"
752 " if (res == PTHREAD_CANCELED)\n"
753 " printf(\"%s(): thread was canceled\\[rs]n\", __func__);\n"
754 " else\n"
755 " printf(\"%s(): thread wasn\\[aq]t canceled (shouldn\\[aq]t happen!)\\[rs]n\",\n"
756 " __func__);\n"
757 " exit(EXIT_SUCCESS);\n"
758 "}\n"
759
760 #. type: TH
761 #: fedora-44 fedora-rawhide
762 #, no-wrap
763 msgid "2024-11-05"
764 msgstr "5 نوفمبر 2024"
765
766 #. type: TH
767 #: fedora-44 fedora-rawhide
768 #, no-wrap
769 msgid "Linux man-pages 6.13"
770 msgstr "صفحات دليل لينكس 6.13"
771
772 #. type: TH
773 #: mageia-cauldron
774 #, no-wrap
775 msgid "Linux man-pages 6.17"
776 msgstr "صفحات دليل لينكس 6.17"
777
778 #. type: TH
779 #: opensuse-leap-16-1 opensuse-tumbleweed
780 #, no-wrap
781 msgid "Linux man-pages (unreleased)"
782 msgstr "صفحات دليل لينكس (لم تصدر بعد)"