Debian Codegraph @

po/ar/man3/pthread_setname_np.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-03 06:41+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_setname_np"
25 msgstr "pthread_setname_np"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 فبراير 2026"
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_setname_np, pthread_getname_np - set/get the name of a thread"
51 msgstr "pthread_setname_np, pthread_getname_np - ضبط/الحصول على اسم خيط"
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 ""
78 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
79 "B<#include E<lt>pthread.hE<gt>>\n"
80 msgstr ""
81 "B<#define _GNU_SOURCE> /* انظر feature_test_macros(7) */\n"
82 "B<#include E<lt>pthread.hE<gt>>\n"
83
84 #. type: Plain text
85 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
86 #: opensuse-tumbleweed
87 #, no-wrap
88 msgid ""
89 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
90 "B<int pthread_getname_np(>size_t size;\n"
91 "B< pthread_t >I<thread>B<, char >I<name>B<[>I<size>B<], size_t >I<size>B<);>\n"
92 msgstr ""
93 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
94 "B<int pthread_getname_np(>size_t size;\n"
95 "B< pthread_t >I<thread>B<, char >I<name>B<[>I<size>B<], size_t >I<size>B<);>\n"
96
97 #. type: SH
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid "DESCRIPTION"
102 msgstr "الوصف"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid ""
108 "By default, all the threads created using B<pthread_create>() inherit the "
109 "program name. The B<pthread_setname_np>() function can be used to set a "
110 "unique name for a thread, which can be useful for debugging multithreaded "
111 "applications. The thread name is a meaningful C language string, whose "
112 "length is restricted to 16 characters, including the terminating null byte "
113 "(\\[aq]\\[rs]0\\[aq]). The I<thread> argument specifies the thread whose "
114 "name is to be changed; I<name> specifies the new name."
115 msgstr ""
116 "بشكل مبدئي، ترث جميع الخيوط المنشأة باستخدام B<pthread_create>() اسم "
117 "البرنامج. يمكن استخدام دالة B<pthread_setname_np>() لضبط اسم فريد لخيط، وهو "
118 "ما قد يكون مفيدًا لتصحيح تطبيقات متعددة الخيوط. اسم الخيط هو سلسلة محارف ذات "
119 "معنى بلغة C، ويقتصر طولها على 16 حرفًا، بما في ذلك البايت الختامي الصفري "
120 "(\\[aq]\\[rs]0\\[aq]). تُحدد الوسيطة I<thread> الخيط الذي سيُغيَّر اسمه؛ وتُحدد "
121 "I<name> الاسم الجديد."
122
123 #. type: Plain text
124 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
125 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
126 msgid ""
127 "The B<pthread_getname_np>() function can be used to retrieve the name of "
128 "the thread. The I<thread> argument specifies the thread whose name is to be "
129 "retrieved. The buffer I<name> is used to return the thread name; I<size> "
130 "specifies the number of bytes available in I<name>. The buffer specified by "
131 "I<name> should be at least 16 characters in length. The returned thread "
132 "name in the output buffer will be null terminated."
133 msgstr ""
134 "يمكن استخدام دالة B<pthread_getname_np>() لاسترجاع اسم الخيط. تُحدد الوسيطة "
135 "I<thread> الخيط الذي سيُسترجَع اسمه. يُستخدم المخزن المؤقت I<name> لإرجاع اسم "
136 "الخيط؛ وتُحدد I<size> عدد البايتات المتاحة في I<name>. يجب أن يكون المخزن "
137 "المؤقت المُحدَّد بواسطة I<name> بطول 16 حرفًا على الأقل. سيكون اسم الخيط المُرجَع "
138 "في المخزن المؤقت للإخراج منتهيًا بصفر."
139
140 #. type: SH
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 #, no-wrap
144 msgid "RETURN VALUE"
145 msgstr "قيمة الإرجاع"
146
147 #. type: Plain text
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 msgid ""
151 "On success, these functions return 0; on error, they return a nonzero error "
152 "number."
153 msgstr ""
154 "عند النجاح، تُعيد هذه الدوال القيمة 0؛ وعند الخطأ، تُعيد رقم خطأ غير صفري."
155
156 #. type: SH
157 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
158 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
159 #, no-wrap
160 msgid "ERRORS"
161 msgstr "الأخطاء"
162
163 #. type: Plain text
164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
166 msgid ""
167 "The B<pthread_setname_np>() function can fail with the following error:"
168 msgstr "قد تفشل دالة B<pthread_setname_np>() مع الخطأ التالي:"
169
170 #. type: TP
171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
173 #, no-wrap
174 msgid "B<ERANGE>"
175 msgstr "B<ERANGE>"
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "The length of the string specified pointed to by I<name> exceeds the allowed "
182 "limit."
183 msgstr "يتجاوز طول السلسلة المُشار إليها بواسطة I<name> الحد المسموح به."
184
185 #. type: Plain text
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 msgid ""
189 "The B<pthread_getname_np>() function can fail with the following error:"
190 msgstr "قد تفشل دالة B<pthread_getname_np>() مع الخطأ التالي:"
191
192 #. type: Plain text
193 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
194 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
195 msgid ""
196 "The buffer specified by I<name> and I<size> is too small to hold the thread "
197 "name."
198 msgstr ""
199 "المخزن المؤقت المُحدَّد بواسطة I<name> و I<size> صغير جدًا لاحتواء اسم الخيط."
200
201 #. type: Plain text
202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
204 msgid ""
205 "If either of these functions fails to open I</proc/self/task/>tidI</comm>, "
206 "then the call may fail with one of the errors described in B<open>(2)."
207 msgstr ""
208 "إذا فشلت أي من هاتين الدالتين في فتح I</proc/self/task/>tidI</comm>، فقد "
209 "تفشل الاستدعاء مع أحد الأخطاء الموصوفة في B<open>(2)."
210
211 #. type: SH
212 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
213 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
214 #, no-wrap
215 msgid "ATTRIBUTES"
216 msgstr "السمات"
217
218 #. type: Plain text
219 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
220 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
221 msgid ""
222 "For an explanation of the terms used in this section, see B<attributes>(7)."
223 msgstr ""
224 "للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)."
225
226 #. type: tbl table
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 #, no-wrap
230 msgid "Interface"
231 msgstr "الواجهة"
232
233 #. type: tbl table
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid "Attribute"
238 msgstr "السمة"
239
240 #. type: tbl table
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid "Value"
245 msgstr "القيمة"
246
247 #. type: tbl table
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 #, no-wrap
251 msgid ".na\n"
252 msgstr ".na\n"
253
254 #. type: tbl table
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 #, no-wrap
258 msgid ".nh\n"
259 msgstr ".nh\n"
260
261 #. type: tbl table
262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
264 #, no-wrap
265 msgid ""
266 "B<pthread_setname_np>(),\n"
267 "B<pthread_getname_np>()"
268 msgstr ""
269 "B<pthread_setname_np>(),\n"
270 "B<pthread_getname_np>()"
271
272 #. type: tbl table
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 #, no-wrap
276 msgid "Thread safety"
277 msgstr "سلامة الخيوط"
278
279 #. type: tbl table
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 #, no-wrap
283 msgid "MT-Safe"
284 msgstr "MT-Safe"
285
286 #. type: SH
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 #, no-wrap
290 msgid "STANDARDS"
291 msgstr "المعايير"
292
293 #. type: Plain text
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 msgid "GNU; hence the suffix \"_np\" (nonportable) in the names."
297 msgstr "جنو؛ ومن هنا جاءت اللاحقة \"_np\" (غير منقول) في الأسماء."
298
299 #. type: SH
300 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
301 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
302 #, no-wrap
303 msgid "HISTORY"
304 msgstr "التاريخ"
305
306 #. type: Plain text
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 msgid "glibc 2.12."
310 msgstr "glibc 2.12."
311
312 #. type: SH
313 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
314 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
315 #, no-wrap
316 msgid "NOTES"
317 msgstr "ملاحظات"
318
319 #. type: Plain text
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 msgid ""
323 "B<pthread_setname_np>() internally writes to the thread-specific I<comm> "
324 "file under the I</proc> filesystem: I</proc/self/task/>tidI</comm>. "
325 "B<pthread_getname_np>() retrieves it from the same location."
326 msgstr ""
327 "تكتب B<pthread_setname_np>() داخليًا إلى ملف I<comm> الخاص بالخيط تحت نظام "
328 "الملفات I</proc>: I</proc/self/task/>tidI</comm>. تسترجع "
329 "B<pthread_getname_np>() منه من نفس الموقع."
330
331 #. type: SH
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 #, no-wrap
335 msgid "EXAMPLES"
336 msgstr "أمثلة"
337
338 #. type: Plain text
339 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
340 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
341 msgid ""
342 "The program below demonstrates the use of B<pthread_setname_np>() and "
343 "B<pthread_getname_np>()."
344 msgstr ""
345 "يوضح البرنامج أدناه استخدام B<pthread_setname_np>() و "
346 "B<pthread_getname_np>()."
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid "The following shell session shows a sample run of the program:"
352 msgstr "تظهر جلسة الصدفة التالية تشغيلًا نموذجيًا للبرنامج:"
353
354 #. type: Plain text
355 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
356 #: opensuse-tumbleweed
357 #, no-wrap
358 msgid ""
359 "$B< ./a.out>;\n"
360 "Created a thread. Default name is: a.out\n"
361 "The thread name after setting it is THREADFOO.\n"
362 "\\f[B]\\[ha]Z\\fR # Suspend the program\n"
363 "[1]+ Stopped ./a.out\n"
364 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
365 " PID TID CMD COMMAND\n"
366 " 5990 5990 ./a.out a.out\n"
367 " 5990 5991 ./a.out THREADFOO\n"
368 "$ B<cat /proc/5990/task/5990/comm>\n"
369 "a.out\n"
370 "$ B<cat /proc/5990/task/5991/comm>\n"
371 "THREADFOO\n"
372 msgstr ""
373 "$B< ./a.out>;\n"
374 "Created a thread. Default name is: a.out\n"
375 "The thread name after setting it is THREADFOO.\n"
376 "\\f[B]\\[ha]Z\\fR # Suspend the program\n"
377 "[1]+ Stopped ./a.out\n"
378 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
379 " PID TID CMD COMMAND\n"
380 " 5990 5990 ./a.out a.out\n"
381 " 5990 5991 ./a.out THREADFOO\n"
382 "$ B<cat /proc/5990/task/5990/comm>\n"
383 "a.out\n"
384 "$ B<cat /proc/5990/task/5991/comm>\n"
385 "THREADFOO\n"
386
387 #. type: SS
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "Program source"
392 msgstr "مصدر البرنامج"
393
394 #. type: Plain text
395 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
396 #: opensuse-tumbleweed
397 #, no-wrap
398 msgid ""
399 "#define _GNU_SOURCE\n"
400 "#include E<lt>err.hE<gt>\n"
401 "#include E<lt>errno.hE<gt>\n"
402 "#include E<lt>pthread.hE<gt>\n"
403 "#include E<lt>stdio.hE<gt>\n"
404 "#include E<lt>stdlib.hE<gt>\n"
405 "#include E<lt>string.hE<gt>\n"
406 "#include E<lt>unistd.hE<gt>\n"
407 "\\&\n"
408 "#define NAMELEN 16\n"
409 "\\&\n"
410 "static void *\n"
411 "threadfunc(void *parm)\n"
412 "{\n"
413 " sleep(5); // allow main program to set the thread name\n"
414 " return NULL;\n"
415 "}\n"
416 "\\&\n"
417 "int\n"
418 "main(int argc, char *argv[])\n"
419 "{\n"
420 " pthread_t thread;\n"
421 " int rc;\n"
422 " char thread_name[NAMELEN];\n"
423 "\\&\n"
424 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
425 " if (rc != 0)\n"
426 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
427 "\\&\n"
428 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
429 " if (rc != 0)\n"
430 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
431 "\\&\n"
432 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
433 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
434 " if (rc != 0)\n"
435 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
436 "\\&\n"
437 " sleep(2);\n"
438 "\\&\n"
439 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
440 " if (rc != 0)\n"
441 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
442 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
443 "\\&\n"
444 " rc = pthread_join(thread, NULL);\n"
445 " if (rc != 0)\n"
446 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
447 "\\&\n"
448 " printf(\"Done\\[rs]n\");\n"
449 " exit(EXIT_SUCCESS);\n"
450 "}\n"
451 msgstr ""
452 "#define _GNU_SOURCE\n"
453 "#include E<lt>err.hE<gt>\n"
454 "#include E<lt>errno.hE<gt>\n"
455 "#include E<lt>pthread.hE<gt>\n"
456 "#include E<lt>stdio.hE<gt>\n"
457 "#include E<lt>stdlib.hE<gt>\n"
458 "#include E<lt>string.hE<gt>\n"
459 "#include E<lt>unistd.hE<gt>\n"
460 "\\&\n"
461 "#define NAMELEN 16\n"
462 "\\&\n"
463 "static void *\n"
464 "threadfunc(void *parm)\n"
465 "{\n"
466 " sleep(5); // allow main program to set the thread name\n"
467 " return NULL;\n"
468 "}\n"
469 "\\&\n"
470 "int\n"
471 "main(int argc, char *argv[])\n"
472 "{\n"
473 " pthread_t thread;\n"
474 " int rc;\n"
475 " char thread_name[NAMELEN];\n"
476 "\\&\n"
477 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
478 " if (rc != 0)\n"
479 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
480 "\\&\n"
481 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
482 " if (rc != 0)\n"
483 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
484 "\\&\n"
485 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
486 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
487 " if (rc != 0)\n"
488 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
489 "\\&\n"
490 " sleep(2);\n"
491 "\\&\n"
492 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
493 " if (rc != 0)\n"
494 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
495 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
496 "\\&\n"
497 " rc = pthread_join(thread, NULL);\n"
498 " if (rc != 0)\n"
499 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
500 "\\&\n"
501 " printf(\"Done\\[rs]n\");\n"
502 " exit(EXIT_SUCCESS);\n"
503 "}\n"
504
505 #. SRC END
506 #. type: SH
507 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
508 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
509 #, no-wrap
510 msgid "SEE ALSO"
511 msgstr "انظر أيضًا"
512
513 #. type: Plain text
514 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
515 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
516 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
517 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
518
519 #. type: TH
520 #: debian-trixie
521 #, no-wrap
522 msgid "2024-06-15"
523 msgstr "15 يونيو 2024"
524
525 #. type: TH
526 #: debian-trixie
527 #, no-wrap
528 msgid "Linux man-pages 6.9.1"
529 msgstr "صفحات دليل لينكس 6.9.1"
530
531 #. type: Plain text
532 #: debian-trixie
533 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
534 msgstr "مكتبة مسالك POSIX (I<libpthread>، I<-lpthread>)"
535
536 #. type: Plain text
537 #: debian-trixie fedora-44 fedora-rawhide
538 #, no-wrap
539 msgid ""
540 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
541 "B<int pthread_getname_np(pthread_t >I<thread>B<, char >I<name>B<[.>I<size>B<], size_t >I<size>B<);>\n"
542 msgstr ""
543 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
544 "B<int pthread_getname_np(pthread_t >I<thread>B<, char >I<name>B<[.>I<size>B<], size_t >I<size>B<);>\n"
545
546 #. type: Plain text
547 #: debian-trixie fedora-44 fedora-rawhide
548 #, no-wrap
549 msgid ""
550 "$B< ./a.out>\n"
551 "Created a thread. Default name is: a.out\n"
552 "The thread name after setting it is THREADFOO.\n"
553 "B<\\[ha]Z> # Suspend the program\n"
554 "[1]+ Stopped ./a.out\n"
555 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
556 " PID TID CMD COMMAND\n"
557 " 5990 5990 ./a.out a.out\n"
558 " 5990 5991 ./a.out THREADFOO\n"
559 "$ B<cat /proc/5990/task/5990/comm>\n"
560 "a.out\n"
561 "$ B<cat /proc/5990/task/5991/comm>\n"
562 "THREADFOO\n"
563 msgstr ""
564 "$B< ./a.out>\n"
565 "Created a thread. Default name is: a.out\n"
566 "The thread name after setting it is THREADFOO.\n"
567 "B<\\[ha]Z> # Suspend the program\n"
568 "[1]+ Stopped ./a.out\n"
569 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
570 " PID TID CMD COMMAND\n"
571 " 5990 5990 ./a.out a.out\n"
572 " 5990 5991 ./a.out THREADFOO\n"
573 "$ B<cat /proc/5990/task/5990/comm>\n"
574 "a.out\n"
575 "$ B<cat /proc/5990/task/5991/comm>\n"
576 "THREADFOO\n"
577
578 #. type: Plain text
579 #: debian-trixie fedora-44 fedora-rawhide
580 #, no-wrap
581 msgid ""
582 "#define _GNU_SOURCE\n"
583 "#include E<lt>err.hE<gt>\n"
584 "#include E<lt>errno.hE<gt>\n"
585 "#include E<lt>pthread.hE<gt>\n"
586 "#include E<lt>stdio.hE<gt>\n"
587 "#include E<lt>stdlib.hE<gt>\n"
588 "#include E<lt>string.hE<gt>\n"
589 "#include E<lt>unistd.hE<gt>\n"
590 "\\&\n"
591 "#define NAMELEN 16\n"
592 "\\&\n"
593 "static void *\n"
594 "threadfunc(void *parm)\n"
595 "{\n"
596 " sleep(5); // allow main program to set the thread name\n"
597 " return NULL;\n"
598 "}\n"
599 "\\&\n"
600 "int\n"
601 "main(int argc, char *argv[])\n"
602 "{\n"
603 " pthread_t thread;\n"
604 " int rc;\n"
605 " char thread_name[NAMELEN];\n"
606 "\\&\n"
607 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
608 " if (rc != 0)\n"
609 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
610 "\\&\n"
611 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
612 " if (rc != 0)\n"
613 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
614 "\\&\n"
615 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
616 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
617 " if (rc != 0)\n"
618 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
619 "\\&\n"
620 " sleep(2);\n"
621 "\\&\n"
622 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
623 " if (rc != 0)\n"
624 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
625 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
626 "\\&\n"
627 " rc = pthread_join(thread, NULL);\n"
628 " if (rc != 0)\n"
629 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
630 "\\&\n"
631 " printf(\"Done\\[rs]n\");\n"
632 " exit(EXIT_SUCCESS);\n"
633 "}\n"
634 msgstr ""
635 "#define _GNU_SOURCE\n"
636 "#include E<lt>err.hE<gt>\n"
637 "#include E<lt>errno.hE<gt>\n"
638 "#include E<lt>pthread.hE<gt>\n"
639 "#include E<lt>stdio.hE<gt>\n"
640 "#include E<lt>stdlib.hE<gt>\n"
641 "#include E<lt>string.hE<gt>\n"
642 "#include E<lt>unistd.hE<gt>\n"
643 "\\&\n"
644 "#define NAMELEN 16\n"
645 "\\&\n"
646 "static void *\n"
647 "threadfunc(void *parm)\n"
648 "{\n"
649 " sleep(5); // allow main program to set the thread name\n"
650 " return NULL;\n"
651 "}\n"
652 "\\&\n"
653 "int\n"
654 "main(int argc, char *argv[])\n"
655 "{\n"
656 " pthread_t thread;\n"
657 " int rc;\n"
658 " char thread_name[NAMELEN];\n"
659 "\\&\n"
660 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
661 " if (rc != 0)\n"
662 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
663 "\\&\n"
664 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
665 " if (rc != 0)\n"
666 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
667 "\\&\n"
668 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
669 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
670 " if (rc != 0)\n"
671 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
672 "\\&\n"
673 " sleep(2);\n"
674 "\\&\n"
675 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
676 " if (rc != 0)\n"
677 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
678 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
679 "\\&\n"
680 " rc = pthread_join(thread, NULL);\n"
681 " if (rc != 0)\n"
682 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
683 "\\&\n"
684 " printf(\"Done\\[rs]n\");\n"
685 " exit(EXIT_SUCCESS);\n"
686 "}\n"
687
688 #. type: TH
689 #: fedora-44 fedora-rawhide
690 #, no-wrap
691 msgid "2024-07-23"
692 msgstr "23 يوليو 2024"
693
694 #. type: TH
695 #: fedora-44 fedora-rawhide
696 #, no-wrap
697 msgid "Linux man-pages 6.13"
698 msgstr "صفحات دليل لينكس 6.13"
699
700 #. type: TH
701 #: mageia-cauldron
702 #, no-wrap
703 msgid "Linux man-pages 6.17"
704 msgstr "صفحات دليل لينكس 6.17"
705
706 #. type: TH
707 #: opensuse-leap-16-1 opensuse-tumbleweed
708 #, no-wrap
709 msgid "Linux man-pages (unreleased)"
710 msgstr "صفحات دليل لينكس (لم تصدر بعد)"