Debian Codegraph @

po/ru/man3/pthread_setname_np.3.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Alexey, 2016.
5 # Azamat Hackimov <[email protected]>, 2014-2017.
6 # kogamatranslator49 <[email protected]>, 2015.
7 # Darima Kogan <[email protected]>, 2014.
8 # Max Is <[email protected]>, 2016.
9 # Yuri Kozlov <[email protected]>, 2011-2019.
10 # Иван Павлов <[email protected]>, 2017.
11 msgid ""
12 msgstr ""
13 "Project-Id-Version: manpages-l10n\n"
14 "POT-Creation-Date: 2026-06-05 06:38+0200\n"
15 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
16 "Last-Translator: Yuri Kozlov <[email protected]>\n"
17 "Language-Team: Russian <[email protected]>\n"
18 "Language: ru\n"
19 "MIME-Version: 1.0\n"
20 "Content-Type: text/plain; charset=UTF-8\n"
21 "Content-Transfer-Encoding: 8bit\n"
22 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
23 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
24 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
25 "X-Generator: Lokalize 2.0\n"
26
27 #. type: TH
28 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
29 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
30 #, no-wrap
31 msgid "pthread_setname_np"
32 msgstr ""
33
34 #. type: TH
35 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
36 #: opensuse-tumbleweed
37 #, no-wrap
38 msgid "2026-02-08"
39 msgstr "8 февраля 2026 г."
40
41 #. type: TH
42 #: archlinux debian-unstable
43 #, fuzzy, no-wrap
44 #| msgid "Linux man-pages 6.17"
45 msgid "Linux man-pages 6.18"
46 msgstr "Справочные страницы Linux 6.17"
47
48 #. type: SH
49 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
50 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
51 #, no-wrap
52 msgid "NAME"
53 msgstr "НАИМЕНОВАНИЕ"
54
55 #. type: Plain text
56 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
57 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
58 msgid "pthread_setname_np, pthread_getname_np - set/get the name of a thread"
59 msgstr "pthread_setname_np, pthread_getname_np - изменяет/возвращает имя нити"
60
61 #. type: SH
62 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
63 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
64 #, no-wrap
65 msgid "LIBRARY"
66 msgstr "БИБЛИОТЕКА"
67
68 #. type: Plain text
69 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
70 #: opensuse-leap-16-1 opensuse-tumbleweed
71 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
72 msgstr "Библиотека потоков POSIX (I<libpthread>,\\ I<-lpthread>)"
73
74 #. type: SH
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 #, no-wrap
78 msgid "SYNOPSIS"
79 msgstr "СИНТАКСИС"
80
81 #. type: Plain text
82 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
83 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
84 #, no-wrap
85 msgid ""
86 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
87 "B<#include E<lt>pthread.hE<gt>>\n"
88 msgstr ""
89 "B<#define _GNU_SOURCE> /* Смотрите feature_test_macros(7) */\n"
90 "B<#include E<lt>pthread.hE<gt>>\n"
91
92 #. type: Plain text
93 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
94 #: opensuse-tumbleweed
95 #, fuzzy, no-wrap
96 #| msgid ""
97 #| "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
98 #| "B<#include E<lt>pthread.hE<gt>>\n"
99 #| "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
100 #| "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
101 #| "B< char *>I<name>B<, size_t >I<len>B<);>\n"
102 msgid ""
103 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
104 "B<int pthread_getname_np(>size_t size;\n"
105 "B< pthread_t >I<thread>B<, char >I<name>B<[>I<size>B<], size_t >I<size>B<);>\n"
106 msgstr ""
107 "B<#define _GNU_SOURCE> /* смотрите feature_test_macros(7) */\n"
108 "B<#include E<lt>pthread.hE<gt>>\n"
109 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
110 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
111 "B< char *>I<name>B<, size_t >I<len>B<);>\n"
112
113 #. type: SH
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 #, no-wrap
117 msgid "DESCRIPTION"
118 msgstr "ОПИСАНИЕ"
119
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 #, fuzzy
124 #| msgid ""
125 #| "By default, all the threads created using B<pthread_create>() inherit "
126 #| "the program name. The B<pthread_setname_np>() function can be used to "
127 #| "set a unique name for a thread, which can be useful for debugging "
128 #| "multithreaded applications. The thread name is a meaningful C language "
129 #| "string, whose length is restricted to 16 characters, including the "
130 #| "terminating null byte (\\(aq\\e0\\(aq). The I<thread> argument specifies "
131 #| "the thread whose name is to be changed; I<name> specifies the new name."
132 msgid ""
133 "By default, all the threads created using B<pthread_create>() inherit the "
134 "program name. The B<pthread_setname_np>() function can be used to set a "
135 "unique name for a thread, which can be useful for debugging multithreaded "
136 "applications. The thread name is a meaningful C language string, whose "
137 "length is restricted to 16 characters, including the terminating null byte "
138 "(\\[aq]\\[rs]0\\[aq]). The I<thread> argument specifies the thread whose "
139 "name is to be changed; I<name> specifies the new name."
140 msgstr ""
141 "По умолчанию, все нити, созданные B<pthread_create>(), наследуют имя "
142 "программы. Функция B<pthread_setname_np>() позволяет задать уникальное имя "
143 "нити, которое можно использовать при отладки многонитевых приложений. Имя "
144 "нити задаётся по правилам строк языка C, его длина ограничена 16 символами, "
145 "включая конечный байт null (\\(aq\\e0\\(aq). В аргументе I<thread> "
146 "указывается нить, чьё имя будет изменено; в I<name> указывается новое имя."
147
148 #. type: Plain text
149 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
150 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
151 #, fuzzy
152 #| msgid ""
153 #| "The B<pthread_getname_np>() function can be used to retrieve the name of "
154 #| "the thread. The I<thread> argument specifies the thread whose name is to "
155 #| "be retrieved. The buffer I<name> is used to return the thread name; "
156 #| "I<len> specifies the number of bytes available in I<name>. The buffer "
157 #| "specified by I<name> should be at least 16 characters in length. The "
158 #| "returned thread name in the output buffer will be null terminated."
159 msgid ""
160 "The B<pthread_getname_np>() function can be used to retrieve the name of "
161 "the thread. The I<thread> argument specifies the thread whose name is to be "
162 "retrieved. The buffer I<name> is used to return the thread name; I<size> "
163 "specifies the number of bytes available in I<name>. The buffer specified by "
164 "I<name> should be at least 16 characters in length. The returned thread "
165 "name in the output buffer will be null terminated."
166 msgstr ""
167 "Функция B<pthread_getname_np>() возвращает имя нити. В аргументе I<thread> "
168 "указывает нить, чьё имя будет возвращено. В буфер I<name> возвращается имя "
169 "нити; в аргументе I<len> указывается количество байт, доступное в I<name>. "
170 "Длина буфера I<name> должна быть не менее 16 символов. Возвращаемое имя в "
171 "выходном буфере завершается байтом null."
172
173 #. type: SH
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 #, no-wrap
177 msgid "RETURN VALUE"
178 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
179
180 #. type: Plain text
181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
183 msgid ""
184 "On success, these functions return 0; on error, they return a nonzero error "
185 "number."
186 msgstr ""
187 "При успешном выполнении эти функции возвращают 0; при ошибке возвращается "
188 "ненулевой номер ошибки."
189
190 #. type: SH
191 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
192 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
193 #, no-wrap
194 msgid "ERRORS"
195 msgstr "ОШИБКИ"
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 B<pthread_setname_np>() function can fail with the following error:"
202 msgstr ""
203 "Функция B<pthread_setname_np>() может завершиться со следующей ошибкой:"
204
205 #. type: TP
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 #, no-wrap
209 msgid "B<ERANGE>"
210 msgstr "B<ERANGE>"
211
212 #. type: Plain text
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 msgid ""
216 "The length of the string specified pointed to by I<name> exceeds the allowed "
217 "limit."
218 msgstr "Длина строки, на которую ссылается I<name>, превышает разрешённую."
219
220 #. type: Plain text
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 msgid ""
224 "The B<pthread_getname_np>() function can fail with the following error:"
225 msgstr ""
226 "Функция B<pthread_getname_np>() может завершиться со следующей ошибкой:"
227
228 #. type: Plain text
229 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
230 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
231 #, fuzzy
232 #| msgid ""
233 #| "The buffer specified by I<name> and I<len> is too small to hold the "
234 #| "thread name."
235 msgid ""
236 "The buffer specified by I<name> and I<size> is too small to hold the thread "
237 "name."
238 msgstr "Буфер, задаваемый I<name> и I<len>, слишком мал для имени нити."
239
240 #. type: Plain text
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, fuzzy
244 #| msgid ""
245 #| "If either of these functions fails to open I</proc/self/task/[tid]/comm>, "
246 #| "then the call may fail with one of the errors described in B<open>(2)."
247 msgid ""
248 "If either of these functions fails to open I</proc/self/task/>tidI</comm>, "
249 "then the call may fail with one of the errors described in B<open>(2)."
250 msgstr ""
251 "Если одна из этих функций завершается с ошибкой открытия I</proc/self/task/"
252 "[tid]/comm>, то вызов может завершиться одной из ошибок, описанных в "
253 "B<open>(2)."
254
255 #. type: SH
256 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
257 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
258 #, no-wrap
259 msgid "ATTRIBUTES"
260 msgstr "АТРИБУТЫ"
261
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 msgid ""
266 "For an explanation of the terms used in this section, see B<attributes>(7)."
267 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
268
269 #. type: tbl table
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 #, no-wrap
273 msgid "Interface"
274 msgstr "Интерфейс"
275
276 #. type: tbl table
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 #, no-wrap
280 msgid "Attribute"
281 msgstr "Атрибут"
282
283 #. type: tbl table
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 #, no-wrap
287 msgid "Value"
288 msgstr "Значение"
289
290 #. type: tbl table
291 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
292 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
293 #, no-wrap
294 msgid ".na\n"
295 msgstr ".na\n"
296
297 #. type: tbl table
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 #, no-wrap
301 msgid ".nh\n"
302 msgstr ".nh\n"
303
304 #. type: tbl table
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid ""
309 "B<pthread_setname_np>(),\n"
310 "B<pthread_getname_np>()"
311 msgstr ""
312 "B<pthread_setname_np>(),\n"
313 "B<pthread_getname_np>()"
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 "STANDARDS"
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 "GNU; hence the suffix \"_np\" (nonportable) in the names."
340 msgstr ""
341 "GNU, о чём свидетельствует наличие суффикса «_np» (nonportable) в именах."
342
343 #. type: SH
344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
346 #, no-wrap
347 msgid "HISTORY"
348 msgstr "ИСТОРИЯ"
349
350 #. type: Plain text
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 msgid "glibc 2.12."
354 msgstr "glibc 2.12."
355
356 #. type: SH
357 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
358 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
359 #, no-wrap
360 msgid "NOTES"
361 msgstr "ПРИМЕЧАНИЯ"
362
363 #. type: Plain text
364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
366 #, fuzzy
367 #| msgid ""
368 #| "B<pthread_setname_np>() internally writes to the thread-specific I<comm> "
369 #| "file under the I</proc> filesystem: I</proc/self/task/[tid]/comm>. "
370 #| "B<pthread_getname_np>() retrieves it from the same location."
371 msgid ""
372 "B<pthread_setname_np>() internally writes to the thread-specific I<comm> "
373 "file under the I</proc> filesystem: I</proc/self/task/>tidI</comm>. "
374 "B<pthread_getname_np>() retrieves it from the same location."
375 msgstr ""
376 "Запись B<pthread_setname_np>() выполняет через файл нити I<comm> из файловой "
377 "системы I</proc>: I</proc/self/task/[tid]/comm>. Функция "
378 "B<pthread_getname_np>() также используется его для возврата имени."
379
380 #. type: SH
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid "EXAMPLES"
385 msgstr "ПРИМЕРЫ"
386
387 #. type: Plain text
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 msgid ""
391 "The program below demonstrates the use of B<pthread_setname_np>() and "
392 "B<pthread_getname_np>()."
393 msgstr ""
394 "Представленная ниже программа показывает использование "
395 "B<pthread_setname_np>() и B<pthread_getname_np>()."
396
397 #. type: Plain text
398 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
399 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
400 msgid "The following shell session shows a sample run of the program:"
401 msgstr "Пример сеанса работы с программой:"
402
403 #. type: Plain text
404 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
405 #: opensuse-tumbleweed
406 #, fuzzy, no-wrap
407 #| msgid ""
408 #| "$B< ./a.out>\n"
409 #| "Created a thread. Default name is: a.out\n"
410 #| "The thread name after setting it is THREADFOO.\n"
411 #| "B<^Z> # Suspend the program\n"
412 #| "[1]+ Stopped ./a.out\n"
413 #| "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
414 #| " PID TID CMD COMMAND\n"
415 #| " 5990 5990 ./a.out a.out\n"
416 #| " 5990 5991 ./a.out THREADFOO\n"
417 #| "$ B<cat /proc/5990/task/5990/comm>\n"
418 #| "a.out\n"
419 #| "$ B<cat /proc/5990/task/5991/comm>\n"
420 #| "THREADFOO\n"
421 msgid ""
422 "$B< ./a.out>;\n"
423 "Created a thread. Default name is: a.out\n"
424 "The thread name after setting it is THREADFOO.\n"
425 "\\f[B]\\[ha]Z\\fR # Suspend the program\n"
426 "[1]+ Stopped ./a.out\n"
427 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
428 " PID TID CMD COMMAND\n"
429 " 5990 5990 ./a.out a.out\n"
430 " 5990 5991 ./a.out THREADFOO\n"
431 "$ B<cat /proc/5990/task/5990/comm>\n"
432 "a.out\n"
433 "$ B<cat /proc/5990/task/5991/comm>\n"
434 "THREADFOO\n"
435 msgstr ""
436 "$B< ./a.out>\n"
437 "Нить создана. Имя по умолчанию: a.out\n"
438 "Имя нити после изменения — THREADFOO.\n"
439 "B<^Z> # Приостановка программы\n"
440 "[1]+ Stopped ./a.out\n"
441 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
442 " PID TID CMD COMMAND\n"
443 " 5990 5990 ./a.out a.out\n"
444 " 5990 5991 ./a.out THREADFOO\n"
445 "$ B<cat /proc/5990/task/5990/comm>\n"
446 "a.out\n"
447 "$ B<cat /proc/5990/task/5991/comm>\n"
448 "THREADFOO\n"
449
450 #. type: SS
451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
453 #, no-wrap
454 msgid "Program source"
455 msgstr "Исходный код программы"
456
457 #. type: Plain text
458 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
459 #: opensuse-tumbleweed
460 #, no-wrap
461 msgid ""
462 "#define _GNU_SOURCE\n"
463 "#include E<lt>err.hE<gt>\n"
464 "#include E<lt>errno.hE<gt>\n"
465 "#include E<lt>pthread.hE<gt>\n"
466 "#include E<lt>stdio.hE<gt>\n"
467 "#include E<lt>stdlib.hE<gt>\n"
468 "#include E<lt>string.hE<gt>\n"
469 "#include E<lt>unistd.hE<gt>\n"
470 "\\&\n"
471 "#define NAMELEN 16\n"
472 "\\&\n"
473 "static void *\n"
474 "threadfunc(void *parm)\n"
475 "{\n"
476 " sleep(5); // allow main program to set the thread name\n"
477 " return NULL;\n"
478 "}\n"
479 "\\&\n"
480 "int\n"
481 "main(int argc, char *argv[])\n"
482 "{\n"
483 " pthread_t thread;\n"
484 " int rc;\n"
485 " char thread_name[NAMELEN];\n"
486 "\\&\n"
487 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
488 " if (rc != 0)\n"
489 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
490 "\\&\n"
491 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
492 " if (rc != 0)\n"
493 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
494 "\\&\n"
495 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
496 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
497 " if (rc != 0)\n"
498 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
499 "\\&\n"
500 " sleep(2);\n"
501 "\\&\n"
502 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
503 " if (rc != 0)\n"
504 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
505 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
506 "\\&\n"
507 " rc = pthread_join(thread, NULL);\n"
508 " if (rc != 0)\n"
509 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
510 "\\&\n"
511 " printf(\"Done\\[rs]n\");\n"
512 " exit(EXIT_SUCCESS);\n"
513 "}\n"
514 msgstr ""
515
516 #. SRC END
517 #. type: SH
518 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
519 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
520 #, no-wrap
521 msgid "SEE ALSO"
522 msgstr "СМОТРИТЕ ТАКЖЕ"
523
524 #. type: Plain text
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 msgid "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
528 msgstr "B<prctl>(2), B<pthread_create>(3), B<pthreads>(7)"
529
530 #. type: TH
531 #: debian-trixie
532 #, no-wrap
533 msgid "2024-06-15"
534 msgstr "15 июня 2024 г."
535
536 #. type: TH
537 #: debian-trixie
538 #, no-wrap
539 msgid "Linux man-pages 6.9.1"
540 msgstr "Страницы руководства Linux 6.9.1"
541
542 #. type: Plain text
543 #: debian-trixie
544 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
545 msgstr "Библиотека потоков POSIX (I<libpthread>, I<-lpthread>)"
546
547 #. type: Plain text
548 #: debian-trixie fedora-44 fedora-rawhide
549 #, fuzzy, no-wrap
550 #| msgid ""
551 #| "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
552 #| "B<#include E<lt>pthread.hE<gt>>\n"
553 #| "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
554 #| "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
555 #| "B< char *>I<name>B<, size_t >I<len>B<);>\n"
556 msgid ""
557 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
558 "B<int pthread_getname_np(pthread_t >I<thread>B<, char >I<name>B<[.>I<size>B<], size_t >I<size>B<);>\n"
559 msgstr ""
560 "B<#define _GNU_SOURCE> /* смотрите feature_test_macros(7) */\n"
561 "B<#include E<lt>pthread.hE<gt>>\n"
562 "B<int pthread_setname_np(pthread_t >I<thread>B<, const char *>I<name>B<);>\n"
563 "B<int pthread_getname_np(pthread_t >I<thread>B<,>\n"
564 "B< char *>I<name>B<, size_t >I<len>B<);>\n"
565
566 #. type: Plain text
567 #: debian-trixie fedora-44 fedora-rawhide
568 #, fuzzy, no-wrap
569 #| msgid ""
570 #| "$B< ./a.out>\n"
571 #| "Created a thread. Default name is: a.out\n"
572 #| "The thread name after setting it is THREADFOO.\n"
573 #| "B<^Z> # Suspend the program\n"
574 #| "[1]+ Stopped ./a.out\n"
575 #| "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
576 #| " PID TID CMD COMMAND\n"
577 #| " 5990 5990 ./a.out a.out\n"
578 #| " 5990 5991 ./a.out THREADFOO\n"
579 #| "$ B<cat /proc/5990/task/5990/comm>\n"
580 #| "a.out\n"
581 #| "$ B<cat /proc/5990/task/5991/comm>\n"
582 #| "THREADFOO\n"
583 msgid ""
584 "$B< ./a.out>\n"
585 "Created a thread. Default name is: a.out\n"
586 "The thread name after setting it is THREADFOO.\n"
587 "B<\\[ha]Z> # Suspend the program\n"
588 "[1]+ Stopped ./a.out\n"
589 "$ B<ps H -C a.out -o \\[aq]pid tid cmd comm\\[aq]>\n"
590 " PID TID CMD COMMAND\n"
591 " 5990 5990 ./a.out a.out\n"
592 " 5990 5991 ./a.out THREADFOO\n"
593 "$ B<cat /proc/5990/task/5990/comm>\n"
594 "a.out\n"
595 "$ B<cat /proc/5990/task/5991/comm>\n"
596 "THREADFOO\n"
597 msgstr ""
598 "$B< ./a.out>\n"
599 "Нить создана. Имя по умолчанию: a.out\n"
600 "Имя нити после изменения — THREADFOO.\n"
601 "B<^Z> # Приостановка программы\n"
602 "[1]+ Stopped ./a.out\n"
603 "$ B<ps H -C a.out -o 'pid tid cmd comm'>\n"
604 " PID TID CMD COMMAND\n"
605 " 5990 5990 ./a.out a.out\n"
606 " 5990 5991 ./a.out THREADFOO\n"
607 "$ B<cat /proc/5990/task/5990/comm>\n"
608 "a.out\n"
609 "$ B<cat /proc/5990/task/5991/comm>\n"
610 "THREADFOO\n"
611
612 #. type: Plain text
613 #: debian-trixie fedora-44 fedora-rawhide
614 #, no-wrap
615 msgid ""
616 "#define _GNU_SOURCE\n"
617 "#include E<lt>err.hE<gt>\n"
618 "#include E<lt>errno.hE<gt>\n"
619 "#include E<lt>pthread.hE<gt>\n"
620 "#include E<lt>stdio.hE<gt>\n"
621 "#include E<lt>stdlib.hE<gt>\n"
622 "#include E<lt>string.hE<gt>\n"
623 "#include E<lt>unistd.hE<gt>\n"
624 "\\&\n"
625 "#define NAMELEN 16\n"
626 "\\&\n"
627 "static void *\n"
628 "threadfunc(void *parm)\n"
629 "{\n"
630 " sleep(5); // allow main program to set the thread name\n"
631 " return NULL;\n"
632 "}\n"
633 "\\&\n"
634 "int\n"
635 "main(int argc, char *argv[])\n"
636 "{\n"
637 " pthread_t thread;\n"
638 " int rc;\n"
639 " char thread_name[NAMELEN];\n"
640 "\\&\n"
641 " rc = pthread_create(&thread, NULL, threadfunc, NULL);\n"
642 " if (rc != 0)\n"
643 " errc(EXIT_FAILURE, rc, \"pthread_create\");\n"
644 "\\&\n"
645 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
646 " if (rc != 0)\n"
647 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
648 "\\&\n"
649 " printf(\"Created a thread. Default name is: %s\\[rs]n\", thread_name);\n"
650 " rc = pthread_setname_np(thread, (argc E<gt> 1) ? argv[1] : \"THREADFOO\");\n"
651 " if (rc != 0)\n"
652 " errc(EXIT_FAILURE, rc, \"pthread_setname_np\");\n"
653 "\\&\n"
654 " sleep(2);\n"
655 "\\&\n"
656 " rc = pthread_getname_np(thread, thread_name, NAMELEN);\n"
657 " if (rc != 0)\n"
658 " errc(EXIT_FAILURE, rc, \"pthread_getname_np\");\n"
659 " printf(\"The thread name after setting it is %s.\\[rs]n\", thread_name);\n"
660 "\\&\n"
661 " rc = pthread_join(thread, NULL);\n"
662 " if (rc != 0)\n"
663 " errc(EXIT_FAILURE, rc, \"pthread_join\");\n"
664 "\\&\n"
665 " printf(\"Done\\[rs]n\");\n"
666 " exit(EXIT_SUCCESS);\n"
667 "}\n"
668 msgstr ""
669
670 #. type: TH
671 #: fedora-44 fedora-rawhide
672 #, no-wrap
673 msgid "2024-07-23"
674 msgstr "23 июля 2024 г."
675
676 #. type: TH
677 #: fedora-44 fedora-rawhide
678 #, no-wrap
679 msgid "Linux man-pages 6.13"
680 msgstr "Страницы руководства Linux 6.13"
681
682 #. type: TH
683 #: mageia-cauldron
684 #, no-wrap
685 msgid "Linux man-pages 6.17"
686 msgstr "Страницы руководства Linux 6.17"
687
688 #. type: TH
689 #: opensuse-leap-16-1 opensuse-tumbleweed
690 #, no-wrap
691 msgid "Linux man-pages (unreleased)"
692 msgstr "Страницы руководства Linux (не выпущены)"