Debian Codegraph @

po/ru/man2/tee.2.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 # Azamat Hackimov <[email protected]>, 2014, 2016-2017.
5 # Dmitry Bolkhovskikh <[email protected]>, 2017.
6 # Yuri Kozlov <[email protected]>, 2011-2019.
7 # Иван Павлов <[email protected]>, 2017, 2019.
8 msgid ""
9 msgstr ""
10 "Project-Id-Version: manpages-l10n\n"
11 "POT-Creation-Date: 2026-06-05 06:48+0200\n"
12 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
13 "Last-Translator: Yuri Kozlov <[email protected]>\n"
14 "Language-Team: Russian <[email protected]>\n"
15 "Language: ru\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
21 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
22 "X-Generator: Lokalize 2.0\n"
23
24 #. type: TH
25 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
26 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
27 #, no-wrap
28 msgid "tee"
29 msgstr "tee"
30
31 #. type: TH
32 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
33 #: opensuse-tumbleweed
34 #, no-wrap
35 msgid "2026-02-08"
36 msgstr "8 февраля 2026 г."
37
38 #. type: TH
39 #: archlinux debian-unstable
40 #, fuzzy, no-wrap
41 #| msgid "Linux man-pages 6.17"
42 msgid "Linux man-pages 6.18"
43 msgstr "Справочные страницы Linux 6.17"
44
45 #. type: SH
46 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
47 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
48 #, no-wrap
49 msgid "NAME"
50 msgstr "НАИМЕНОВАНИЕ"
51
52 #. type: Plain text
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 msgid "tee - duplicating pipe content"
56 msgstr "tee - повторяет содержимое канала"
57
58 #. type: SH
59 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
60 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
61 #, no-wrap
62 msgid "LIBRARY"
63 msgstr "БИБЛИОТЕКА"
64
65 #. type: Plain text
66 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
67 #: opensuse-leap-16-1 opensuse-tumbleweed
68 msgid "Standard C library (I<libc>,\\ I<-lc>)"
69 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
70
71 #. type: SH
72 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
73 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
74 #, no-wrap
75 msgid "SYNOPSIS"
76 msgstr "СИНТАКСИС"
77
78 #. type: Plain text
79 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
80 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
81 #, no-wrap
82 msgid ""
83 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
84 "B<#include E<lt>fcntl.hE<gt>>\n"
85 msgstr ""
86 "B<#define _GNU_SOURCE> /* см. feature_test_macros(7) */\n"
87 "B<#include E<lt>fcntl.hE<gt>>\n"
88
89 #. type: Plain text
90 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
91 #: opensuse-leap-16-1 opensuse-tumbleweed
92 #, fuzzy, no-wrap
93 #| msgid "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned int >I<flags>B<);>\n"
94 msgid "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<size>B<, unsigned int >I<flags>B<);>\n"
95 msgstr "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned int >I<flags>B<);>\n"
96
97 #. Return type was long before glibc 2.7
98 #. type: SH
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid "DESCRIPTION"
103 msgstr "ОПИСАНИЕ"
104
105 #. Example programs http://brick.kernel.dk/snaps
106 #. add a "tee(in, out1, out2)" system call that duplicates the pages
107 #. (again, incrementing their reference count, not copying the data) from
108 #. one pipe to two other pipes.
109 #. type: Plain text
110 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
111 #: opensuse-leap-16-1 opensuse-tumbleweed
112 #, fuzzy
113 #| msgid ""
114 #| "B<tee>() duplicates up to I<len> bytes of data from the pipe referred to "
115 #| "by the file descriptor I<fd_in> to the pipe referred to by the file "
116 #| "descriptor I<fd_out>. It does not consume the data that is duplicated "
117 #| "from I<fd_in>; therefore, that data can be copied by a subsequent "
118 #| "B<splice>(2)."
119 msgid ""
120 "B<tee>() duplicates up to I<size> bytes of data from the pipe referred to "
121 "by the file descriptor I<fd_in> to the pipe referred to by the file "
122 "descriptor I<fd_out>. It does not consume the data that is duplicated from "
123 "I<fd_in>; therefore, that data can be copied by a subsequent B<splice>(2)."
124 msgstr ""
125 "Вызов B<tee>() повторяет до I<len> байт данных из канала, на который "
126 "указывает файловый дескриптор I<fd_in> в канал, на который указывает "
127 "файловый дескриптор I<fd_out>. Он не потребляет данные, копируемые из "
128 "I<fd_in>, поэтому эти данные можно копировать последующим вызовом "
129 "B<splice>(2)."
130
131 #. type: Plain text
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 msgid ""
135 "I<flags> is a bit mask that is composed by ORing together zero or more of "
136 "the following values:"
137 msgstr ""
138 "Аргумент I<flags> представляет собой битовую маску, которая составляется "
139 "логическим сложением (OR) следующих значений:"
140
141 #. type: TP
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 #, no-wrap
145 msgid "B<SPLICE_F_MOVE>"
146 msgstr "B<SPLICE_F_MOVE>"
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 msgid "Currently has no effect for B<tee>(); see B<splice>(2)."
152 msgstr ""
153 "В данный момент никак не влияет при указании в B<tee>(); см. B<splice>(2)."
154
155 #. type: TP
156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
158 #, no-wrap
159 msgid "B<SPLICE_F_NONBLOCK>"
160 msgstr "B<SPLICE_F_NONBLOCK>"
161
162 #. type: Plain text
163 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
164 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
165 msgid "Do not block on I/O; see B<splice>(2) for further details."
166 msgstr "Не блокировать ввод-вывод; подробности в B<splice>(2)."
167
168 #. type: TP
169 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
170 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
171 #, no-wrap
172 msgid "B<SPLICE_F_MORE>"
173 msgstr "B<SPLICE_F_MORE>"
174
175 #. type: Plain text
176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
178 msgid ""
179 "Currently has no effect for B<tee>(), but may be implemented in the future; "
180 "see B<splice>(2)."
181 msgstr ""
182 "В данный момент никак не влияет при указании в B<tee>(), но это может "
183 "измениться; см. B<splice>(2)."
184
185 #. type: TP
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 #, no-wrap
189 msgid "B<SPLICE_F_GIFT>"
190 msgstr "B<SPLICE_F_GIFT>"
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 "Unused for B<tee>(); see B<vmsplice>(2)."
196 msgstr "Не используется для B<tee>(); см. B<vmsplice>(2)."
197
198 #. type: SH
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 #, no-wrap
202 msgid "RETURN VALUE"
203 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 msgid ""
209 "Upon successful completion, B<tee>() returns the number of bytes that were "
210 "duplicated between the input and output. A return value of 0 means that "
211 "there was no data to transfer, and it would not make sense to block, because "
212 "there are no writers connected to the write end of the pipe referred to by "
213 "I<fd_in>."
214 msgstr ""
215 "При успешном выполнении, B<tee>() возвращает количество байт, которые были "
216 "повторены из ввода в выводе. Возвращаемое значение 0 означает, что нет "
217 "данных для передачи, и блокировка не имеет смысла, так как нет процессов-"
218 "писателей, подключённых к каналу для записи, на который указывает I<fd_in>."
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 "On error, B<tee>() returns -1 and I<errno> is set to indicate the error."
225 msgstr ""
226 "В случае ошибки B<tee>() возвращает -1, а I<errno> устанавливается в "
227 "соответствующее значение."
228
229 #. type: SH
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 #, no-wrap
233 msgid "ERRORS"
234 msgstr "ОШИБКИ"
235
236 #. type: TP
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 #, no-wrap
240 msgid "B<EAGAIN>"
241 msgstr "B<EAGAIN>"
242
243 #. type: Plain text
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 msgid ""
247 "B<SPLICE_F_NONBLOCK> was specified in I<flags> or one of the file "
248 "descriptors had been marked as nonblocking (B<O_NONBLOCK>)B<,> and the "
249 "operation would block."
250 msgstr ""
251 "В I<flags> указан B<SPLICE_F_NONBLOCK> или один из файловых дескрипторов был "
252 "помечен как неблокирующий (B<O_NONBLOCK>)B<,> и операция вызвала бы "
253 "блокировку."
254
255 #. type: TP
256 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
257 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
258 #, no-wrap
259 msgid "B<EINVAL>"
260 msgstr "B<EINVAL>"
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 "I<fd_in> or I<fd_out> does not refer to a pipe; or I<fd_in> and I<fd_out> "
267 "refer to the same pipe."
268 msgstr ""
269 "Значение I<fd_in> или I<fd_out> не указывает на канал; I<fd_in> и I<fd_out> "
270 "указывают на один и тот же канал."
271
272 #. type: TP
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 #, no-wrap
276 msgid "B<ENOMEM>"
277 msgstr "B<ENOMEM>"
278
279 #. type: Plain text
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 msgid "Out of memory."
283 msgstr "Не хватает памяти."
284
285 #. type: SH
286 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
287 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
288 #, no-wrap
289 msgid "STANDARDS"
290 msgstr "СТАНДАРТЫ"
291
292 #. type: Plain text
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 msgid "Linux."
296 msgstr "Linux."
297
298 #. type: SH
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, no-wrap
302 msgid "HISTORY"
303 msgstr "ИСТОРИЯ"
304
305 #. type: Plain text
306 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
307 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
308 msgid "Linux 2.6.17, glibc 2.5."
309 msgstr "Linux 2.6.17, glibc 2.5."
310
311 #. type: SH
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "NOTES"
316 msgstr "ПРИМЕЧАНИЯ"
317
318 #. type: Plain text
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 msgid ""
322 "Conceptually, B<tee>() copies the data between the two pipes. In reality "
323 "no real data copying takes place though: under the covers, B<tee>() assigns "
324 "data to the output by merely grabbing a reference to the input."
325 msgstr ""
326 "Концептуально, B<tee>() копирует данные между двумя каналами. В реальности, "
327 "данные не копируются на самом деле: внутри, B<tee>() назначает данные на "
328 "вывод просто схватывая ссылку из ввода."
329
330 #. type: SH
331 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
332 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
333 #, no-wrap
334 msgid "EXAMPLES"
335 msgstr "ПРИМЕРЫ"
336
337 #. type: Plain text
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 msgid ""
341 "The example below implements a basic B<tee>(1) program using the B<tee>() "
342 "system call. Here is an example of its use:"
343 msgstr ""
344 "В примере далее показана простая реализация программы B<tee>(1) с помощью "
345 "системного вызова B<tee>(). Пример использования:"
346
347 #. type: Plain text
348 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
349 #: opensuse-tumbleweed
350 #, fuzzy, no-wrap
351 #| msgid ""
352 #| "$ B<date | ./a.out out.log | cat>\n"
353 #| "Tue Oct 28 10:06:00 CET 2014\n"
354 #| "$ B<cat out.log>\n"
355 #| "Tue Oct 28 10:06:00 CET 2014\n"
356 msgid ""
357 "$B< date | ./a.out out.log | cat>;\n"
358 "Tue Oct 28 10:06:00 CET 2014\n"
359 "$B< cat out.log>;\n"
360 "Tue Oct 28 10:06:00 CET 2014\n"
361 msgstr ""
362 "$ B<date | ./a.out out.log | cat>\n"
363 "Tue Oct 28 10:06:00 CET 2014\n"
364 "$ B<cat out.log>\n"
365 "Tue Oct 28 10:06:00 CET 2014\n"
366
367 #. type: SS
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 #, no-wrap
371 msgid "Program source"
372 msgstr "Исходный код программы"
373
374 #. type: Plain text
375 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
376 #: opensuse-leap-16-1 opensuse-tumbleweed
377 #, fuzzy, no-wrap
378 #| msgid ""
379 #| "#define _GNU_SOURCE\n"
380 #| "#include E<lt>errno.hE<gt>\n"
381 #| "#include E<lt>fcntl.hE<gt>\n"
382 #| "#include E<lt>limits.hE<gt>\n"
383 #| "#include E<lt>stdio.hE<gt>\n"
384 #| "#include E<lt>stdlib.hE<gt>\n"
385 #| "#include E<lt>sys/types.hE<gt>\n"
386 #| "#include E<lt>unistd.hE<gt>\n"
387 #| "\\&\n"
388 #| "int\n"
389 #| "main(int argc, char *argv[])\n"
390 #| "{\n"
391 #| " int fd;\n"
392 #| " ssize_t len, slen;\n"
393 #| "\\&\n"
394 #| " if (argc != 2) {\n"
395 #| " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\[rs]n\", argv[0]);\n"
396 #| " exit(EXIT_FAILURE);\n"
397 #| " }\n"
398 #| "\\&\n"
399 #| " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
400 #| " if (fd == -1) {\n"
401 #| " perror(\"open\");\n"
402 #| " exit(EXIT_FAILURE);\n"
403 #| " }\n"
404 #| "\\&\n"
405 #| " for (;;) {\n"
406 #| " /*\n"
407 #| " * tee stdin to stdout.\n"
408 #| " */\n"
409 #| " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
410 #| " INT_MAX, SPLICE_F_NONBLOCK);\n"
411 #| " if (len E<lt> 0) {\n"
412 #| " if (errno == EAGAIN)\n"
413 #| " continue;\n"
414 #| " perror(\"tee\");\n"
415 #| " exit(EXIT_FAILURE);\n"
416 #| " }\n"
417 #| " if (len == 0)\n"
418 #| " break;\n"
419 #| "\\&\n"
420 #| " /*\n"
421 #| " * Consume stdin by splicing it to a file.\n"
422 #| " */\n"
423 #| " while (len E<gt> 0) {\n"
424 #| " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
425 #| " len, SPLICE_F_MOVE);\n"
426 #| " if (slen E<lt> 0) {\n"
427 #| " perror(\"splice\");\n"
428 #| " exit(EXIT_FAILURE);\n"
429 #| " }\n"
430 #| " len -= slen;\n"
431 #| " }\n"
432 #| " }\n"
433 #| "\\&\n"
434 #| " close(fd);\n"
435 #| " exit(EXIT_SUCCESS);\n"
436 #| "}\n"
437 msgid ""
438 "#define _GNU_SOURCE\n"
439 "#include E<lt>errno.hE<gt>\n"
440 "#include E<lt>fcntl.hE<gt>\n"
441 "#include E<lt>limits.hE<gt>\n"
442 "#include E<lt>stdio.hE<gt>\n"
443 "#include E<lt>stdlib.hE<gt>\n"
444 "#include E<lt>sys/types.hE<gt>\n"
445 "#include E<lt>unistd.hE<gt>\n"
446 "\\&\n"
447 "int\n"
448 "main(int argc, char *argv[])\n"
449 "{\n"
450 " int fd;\n"
451 " ssize_t size, ssize;\n"
452 "\\&\n"
453 " if (argc != 2) {\n"
454 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\[rs]n\", argv[0]);\n"
455 " exit(EXIT_FAILURE);\n"
456 " }\n"
457 "\\&\n"
458 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
459 " if (fd == -1) {\n"
460 " perror(\"open\");\n"
461 " exit(EXIT_FAILURE);\n"
462 " }\n"
463 "\\&\n"
464 " for (;;) {\n"
465 " /*\n"
466 " * tee stdin to stdout.\n"
467 " */\n"
468 " size = tee(STDIN_FILENO, STDOUT_FILENO,\n"
469 " INT_MAX, SPLICE_F_NONBLOCK);\n"
470 " if (size E<lt> 0) {\n"
471 " if (errno == EAGAIN)\n"
472 " continue;\n"
473 " perror(\"tee\");\n"
474 " exit(EXIT_FAILURE);\n"
475 " }\n"
476 " if (size == 0)\n"
477 " break;\n"
478 "\\&\n"
479 " /*\n"
480 " * Consume stdin by splicing it to a file.\n"
481 " */\n"
482 " while (size E<gt> 0) {\n"
483 " ssize = splice(STDIN_FILENO, NULL, fd, NULL,\n"
484 " size, SPLICE_F_MOVE);\n"
485 " if (ssize E<lt> 0) {\n"
486 " perror(\"splice\");\n"
487 " exit(EXIT_FAILURE);\n"
488 " }\n"
489 " size -= ssize;\n"
490 " }\n"
491 " }\n"
492 "\\&\n"
493 " close(fd);\n"
494 " exit(EXIT_SUCCESS);\n"
495 "}\n"
496 msgstr ""
497 "#define _GNU_SOURCE\n"
498 "#include E<lt>errno.hE<gt>\n"
499 "#include E<lt>fcntl.hE<gt>\n"
500 "#include E<lt>limits.hE<gt>\n"
501 "#include E<lt>stdio.hE<gt>\n"
502 "#include E<lt>stdlib.hE<gt>\n"
503 "#include E<lt>sys/types.hE<gt>\n"
504 "#include E<lt>unistd.hE<gt>\n"
505 "\\&\n"
506 "int\n"
507 "main(int argc, char *argv[])\n"
508 "{\n"
509 " int fd;\n"
510 " ssize_t len, slen;\n"
511 "\\&\n"
512 " if (argc != 2) {\n"
513 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\[rs]n\", argv[0]);\n"
514 " exit(EXIT_FAILURE);\n"
515 " }\n"
516 "\\&\n"
517 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
518 " if (fd == -1) {\n"
519 " perror(\"open\");\n"
520 " exit(EXIT_FAILURE);\n"
521 " }\n"
522 "\\&\n"
523 " for (;;) {\n"
524 " /*\n"
525 " * tee stdin to stdout.\n"
526 " */\n"
527 " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
528 " INT_MAX, SPLICE_F_NONBLOCK);\n"
529 " if (len E<lt> 0) {\n"
530 " if (errno == EAGAIN)\n"
531 " continue;\n"
532 " perror(\"tee\");\n"
533 " exit(EXIT_FAILURE);\n"
534 " }\n"
535 " if (len == 0)\n"
536 " break;\n"
537 "\\&\n"
538 " /*\n"
539 " * Consume stdin by splicing it to a file.\n"
540 " */\n"
541 " while (len E<gt> 0) {\n"
542 " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
543 " len, SPLICE_F_MOVE);\n"
544 " if (slen E<lt> 0) {\n"
545 " perror(\"splice\");\n"
546 " exit(EXIT_FAILURE);\n"
547 " }\n"
548 " len -= slen;\n"
549 " }\n"
550 " }\n"
551 "\\&\n"
552 " close(fd);\n"
553 " exit(EXIT_SUCCESS);\n"
554 "}\n"
555
556 #. SRC END
557 #. type: SH
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 #, no-wrap
561 msgid "SEE ALSO"
562 msgstr "СМОТРИТЕ ТАКЖЕ"
563
564 #. type: Plain text
565 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
566 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
567 msgid "B<splice>(2), B<vmsplice>(2), B<pipe>(7)"
568 msgstr "B<splice>(2), B<vmsplice>(2), B<pipe>(7)"
569
570 #. type: TH
571 #: debian-trixie
572 #, no-wrap
573 msgid "2024-06-15"
574 msgstr "15 июня 2024 г."
575
576 #. type: TH
577 #: debian-trixie
578 #, no-wrap
579 msgid "Linux man-pages 6.9.1"
580 msgstr "Страницы руководства Linux 6.9.1"
581
582 #. type: Plain text
583 #: debian-trixie
584 msgid "Standard C library (I<libc>, I<-lc>)"
585 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
586
587 #. type: Plain text
588 #: debian-trixie
589 #, no-wrap
590 msgid "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned int >I<flags>B<);>\n"
591 msgstr "B<ssize_t tee(int >I<fd_in>B<, int >I<fd_out>B<, size_t >I<len>B<, unsigned int >I<flags>B<);>\n"
592
593 #. Example programs http://brick.kernel.dk/snaps
594 #. add a "tee(in, out1, out2)" system call that duplicates the pages
595 #. (again, incrementing their reference count, not copying the data) from
596 #. one pipe to two other pipes.
597 #. type: Plain text
598 #: debian-trixie
599 msgid ""
600 "B<tee>() duplicates up to I<len> bytes of data from the pipe referred to by "
601 "the file descriptor I<fd_in> to the pipe referred to by the file descriptor "
602 "I<fd_out>. It does not consume the data that is duplicated from I<fd_in>; "
603 "therefore, that data can be copied by a subsequent B<splice>(2)."
604 msgstr ""
605 "Вызов B<tee>() повторяет до I<len> байт данных из канала, на который "
606 "указывает файловый дескриптор I<fd_in> в канал, на который указывает "
607 "файловый дескриптор I<fd_out>. Он не потребляет данные, копируемые из "
608 "I<fd_in>, поэтому эти данные можно копировать последующим вызовом "
609 "B<splice>(2)."
610
611 #. type: Plain text
612 #: debian-trixie fedora-44 fedora-rawhide
613 #, no-wrap
614 msgid ""
615 "$ B<date | ./a.out out.log | cat>\n"
616 "Tue Oct 28 10:06:00 CET 2014\n"
617 "$ B<cat out.log>\n"
618 "Tue Oct 28 10:06:00 CET 2014\n"
619 msgstr ""
620 "$ B<date | ./a.out out.log | cat>\n"
621 "Tue Oct 28 10:06:00 CET 2014\n"
622 "$ B<cat out.log>\n"
623 "Tue Oct 28 10:06:00 CET 2014\n"
624
625 #. type: Plain text
626 #: debian-trixie
627 #, no-wrap
628 msgid ""
629 "#define _GNU_SOURCE\n"
630 "#include E<lt>errno.hE<gt>\n"
631 "#include E<lt>fcntl.hE<gt>\n"
632 "#include E<lt>limits.hE<gt>\n"
633 "#include E<lt>stdio.hE<gt>\n"
634 "#include E<lt>stdlib.hE<gt>\n"
635 "#include E<lt>sys/types.hE<gt>\n"
636 "#include E<lt>unistd.hE<gt>\n"
637 "\\&\n"
638 "int\n"
639 "main(int argc, char *argv[])\n"
640 "{\n"
641 " int fd;\n"
642 " ssize_t len, slen;\n"
643 "\\&\n"
644 " if (argc != 2) {\n"
645 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\[rs]n\", argv[0]);\n"
646 " exit(EXIT_FAILURE);\n"
647 " }\n"
648 "\\&\n"
649 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
650 " if (fd == -1) {\n"
651 " perror(\"open\");\n"
652 " exit(EXIT_FAILURE);\n"
653 " }\n"
654 "\\&\n"
655 " for (;;) {\n"
656 " /*\n"
657 " * tee stdin to stdout.\n"
658 " */\n"
659 " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
660 " INT_MAX, SPLICE_F_NONBLOCK);\n"
661 " if (len E<lt> 0) {\n"
662 " if (errno == EAGAIN)\n"
663 " continue;\n"
664 " perror(\"tee\");\n"
665 " exit(EXIT_FAILURE);\n"
666 " }\n"
667 " if (len == 0)\n"
668 " break;\n"
669 "\\&\n"
670 " /*\n"
671 " * Consume stdin by splicing it to a file.\n"
672 " */\n"
673 " while (len E<gt> 0) {\n"
674 " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
675 " len, SPLICE_F_MOVE);\n"
676 " if (slen E<lt> 0) {\n"
677 " perror(\"splice\");\n"
678 " exit(EXIT_FAILURE);\n"
679 " }\n"
680 " len -= slen;\n"
681 " }\n"
682 " }\n"
683 "\\&\n"
684 " close(fd);\n"
685 " exit(EXIT_SUCCESS);\n"
686 "}\n"
687 msgstr ""
688 "#define _GNU_SOURCE\n"
689 "#include E<lt>errno.hE<gt>\n"
690 "#include E<lt>fcntl.hE<gt>\n"
691 "#include E<lt>limits.hE<gt>\n"
692 "#include E<lt>stdio.hE<gt>\n"
693 "#include E<lt>stdlib.hE<gt>\n"
694 "#include E<lt>sys/types.hE<gt>\n"
695 "#include E<lt>unistd.hE<gt>\n"
696 "\\&\n"
697 "int\n"
698 "main(int argc, char *argv[])\n"
699 "{\n"
700 " int fd;\n"
701 " ssize_t len, slen;\n"
702 "\\&\n"
703 " if (argc != 2) {\n"
704 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\[rs]n\", argv[0]);\n"
705 " exit(EXIT_FAILURE);\n"
706 " }\n"
707 "\\&\n"
708 " fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);\n"
709 " if (fd == -1) {\n"
710 " perror(\"open\");\n"
711 " exit(EXIT_FAILURE);\n"
712 " }\n"
713 "\\&\n"
714 " for (;;) {\n"
715 " /*\n"
716 " * tee stdin to stdout.\n"
717 " */\n"
718 " len = tee(STDIN_FILENO, STDOUT_FILENO,\n"
719 " INT_MAX, SPLICE_F_NONBLOCK);\n"
720 " if (len E<lt> 0) {\n"
721 " if (errno == EAGAIN)\n"
722 " continue;\n"
723 " perror(\"tee\");\n"
724 " exit(EXIT_FAILURE);\n"
725 " }\n"
726 " if (len == 0)\n"
727 " break;\n"
728 "\\&\n"
729 " /*\n"
730 " * Consume stdin by splicing it to a file.\n"
731 " */\n"
732 " while (len E<gt> 0) {\n"
733 " slen = splice(STDIN_FILENO, NULL, fd, NULL,\n"
734 " len, SPLICE_F_MOVE);\n"
735 " if (slen E<lt> 0) {\n"
736 " perror(\"splice\");\n"
737 " exit(EXIT_FAILURE);\n"
738 " }\n"
739 " len -= slen;\n"
740 " }\n"
741 " }\n"
742 "\\&\n"
743 " close(fd);\n"
744 " exit(EXIT_SUCCESS);\n"
745 "}\n"
746
747 #. type: TH
748 #: fedora-44 fedora-rawhide
749 #, no-wrap
750 msgid "2024-11-17"
751 msgstr "17 ноября 2024 г."
752
753 #. type: TH
754 #: fedora-44 fedora-rawhide
755 #, no-wrap
756 msgid "Linux man-pages 6.13"
757 msgstr "Страницы руководства Linux 6.13"
758
759 #. type: TH
760 #: mageia-cauldron
761 #, no-wrap
762 msgid "Linux man-pages 6.17"
763 msgstr "Страницы руководства Linux 6.17"
764
765 #. type: TH
766 #: opensuse-leap-16-1 opensuse-tumbleweed
767 #, no-wrap
768 msgid "Linux man-pages (unreleased)"
769 msgstr "Страницы руководства Linux (не выпущены)"