Debian Codegraph @

po/pt_BR/man2/pipe.2.po

raw
1 # Brazilian Portuguese translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # André Luiz Fassone <[email protected]>, 2000.
5 # Ricardo C.O.Freitas <[email protected]>, 2000.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:35+0200\n"
10 "PO-Revision-Date: 2000-06-02 19:20-0300\n"
11 "Last-Translator: Ricardo C.O.Freitas <[email protected]>\n"
12 "Language-Team: Brazilian Portuguese <debian-l10n-"
13 "[email protected]>\n"
14 "Language: pt_BR\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
19 "X-Generator: Virtaal 1.0.0-beta1\n"
20
21 #. type: TH
22 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
23 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
24 #, no-wrap
25 msgid "pipe"
26 msgstr "pipe"
27
28 #. type: TH
29 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
30 #: opensuse-tumbleweed
31 #, no-wrap
32 msgid "2026-02-08"
33 msgstr "8 fevereiro 2026"
34
35 #. type: TH
36 #: archlinux debian-unstable
37 #, fuzzy, no-wrap
38 #| msgid "Linux man-pages 6.17"
39 msgid "Linux man-pages 6.18"
40 msgstr "Linux man-pages 6.17"
41
42 #. type: SH
43 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
44 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
45 #, no-wrap
46 msgid "NAME"
47 msgstr "NOME"
48
49 #. type: Plain text
50 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
51 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
52 msgid "pipe, pipe2 - create pipe"
53 msgstr "pipe, pipe2 - cria um pipe"
54
55 #. type: SH
56 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
57 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
58 #, no-wrap
59 msgid "LIBRARY"
60 msgstr "BIBLIOTECA"
61
62 #. type: Plain text
63 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
64 #: opensuse-leap-16-1 opensuse-tumbleweed
65 msgid "Standard C library (I<libc>,\\ I<-lc>)"
66 msgstr "Biblioteca C Padrão (I<libc>,\\ I<-lc>)"
67
68 #. type: SH
69 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
70 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
71 #, no-wrap
72 msgid "SYNOPSIS"
73 msgstr "SINOPSE"
74
75 #. type: Plain text
76 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
77 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
78 #, no-wrap
79 msgid "B<#include E<lt>unistd.hE<gt>>\n"
80 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
81
82 #. type: Plain text
83 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
84 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
85 #, fuzzy, no-wrap
86 #| msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
87 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
88 msgstr "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
89
90 #. type: Plain text
91 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
92 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
93 #, no-wrap
94 msgid ""
95 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
96 "B<#include E<lt>fcntl.hE<gt>> /* Definition of B<O_*> constants */\n"
97 "B<#include E<lt>unistd.hE<gt>>\n"
98 msgstr ""
99
100 #. type: Plain text
101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
103 #, no-wrap
104 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
105 msgstr "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
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 #, no-wrap
111 msgid ""
112 "/* On Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64, pipe() has the\n"
113 " following prototype; see VERSIONS */\n"
114 msgstr ""
115
116 #. type: Plain text
117 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
118 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
119 #, no-wrap
120 msgid ""
121 "B<struct fd_pair {>\n"
122 "B<long fd[2];>\n"
123 "B<};>\n"
124 "B<struct fd_pair pipe(void);>\n"
125 msgstr ""
126
127 #. type: SH
128 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
129 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
130 #, no-wrap
131 msgid "DESCRIPTION"
132 msgstr "DESCRIÇÃO"
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 msgid ""
138 "B<pipe>() creates a pipe, a unidirectional data channel that can be used "
139 "for interprocess communication. The array I<pipefd> is used to return two "
140 "file descriptors referring to the ends of the pipe. I<pipefd[0]> refers to "
141 "the read end of the pipe. I<pipefd[1]> refers to the write end of the "
142 "pipe. Data written to the write end of the pipe is buffered by the kernel "
143 "until it is read from the read end of the pipe. For further details, see "
144 "B<pipe>(7)."
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 "If I<flags> is 0, then B<pipe2>() is the same as B<pipe>(). The following "
152 "values can be bitwise ORed in I<flags> to obtain different behavior:"
153 msgstr ""
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<O_CLOEXEC>"
160 msgstr "B<O_CLOEXEC>"
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 ""
166 "Set the close-on-exec (B<FD_CLOEXEC>) flag on the two new file "
167 "descriptors. See the description of the same flag in B<open>(2) for "
168 "reasons why this may be useful."
169 msgstr ""
170
171 #. type: TP
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 #, no-wrap
175 msgid "B<O_DIRECT> (since Linux 3.4)"
176 msgstr ""
177
178 #. commit 9883035ae7edef3ec62ad215611cb8e17d6a1a5d
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "Create a pipe that performs I/O in \"packet\" mode. Each B<write>(2) to "
184 "the pipe is dealt with as a separate packet, and B<read>(2)s from the pipe "
185 "will read one packet at a time. Note the following points:"
186 msgstr ""
187
188 #. type: IP
189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
191 #, no-wrap
192 msgid "\\[bu]"
193 msgstr "\\[bu]"
194
195 #. type: Plain text
196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
198 msgid ""
199 "Writes of greater than B<PIPE_BUF> bytes (see B<pipe>(7)) will be split "
200 "into multiple packets. The constant B<PIPE_BUF> is defined in "
201 "I<E<lt>limits.hE<gt>>."
202 msgstr ""
203
204 #. type: Plain text
205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
207 msgid ""
208 "If a B<read>(2) specifies a buffer size that is smaller than the next "
209 "packet, then the requested number of bytes are read, and the excess bytes in "
210 "the packet are discarded. Specifying a buffer size of B<PIPE_BUF> will be "
211 "sufficient to read the largest possible packets (see the previous point)."
212 msgstr ""
213
214 #. type: Plain text
215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
217 msgid ""
218 "Zero-length packets are not supported. (A B<read>(2) that specifies a "
219 "buffer size of zero is a no-op, and returns 0.)"
220 msgstr ""
221
222 #. type: Plain text
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 msgid ""
226 "Older kernels that do not support this flag will indicate this via an "
227 "B<EINVAL> error."
228 msgstr ""
229
230 #. commit 0dbf5f20652108106cb822ad7662c786baaa03ff
231 #. FIXME . But, it is not possible to specify O_DIRECT when opening a FIFO
232 #. type: Plain text
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 msgid ""
236 "Since Linux 4.5, it is possible to change the B<O_DIRECT> setting of a pipe "
237 "file descriptor using B<fcntl>(2)."
238 msgstr ""
239
240 #. type: TP
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid "B<O_NONBLOCK>"
245 msgstr "B<O_NONBLOCK>"
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid ""
251 "Set the B<O_NONBLOCK> file status flag on the open file descriptions "
252 "referred to by the new file descriptors. Using this flag saves extra calls "
253 "to B<fcntl>(2) to achieve the same result."
254 msgstr ""
255
256 #. type: TP
257 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
258 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
259 #, no-wrap
260 msgid "B<O_NOTIFICATION_PIPE>"
261 msgstr ""
262
263 #. commit c73be61cede5882f9605a852414db559c0ebedfd
264 #. type: Plain text
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 msgid ""
268 "Since Linux 5.8, general notification mechanism is built on the top of the "
269 "pipe where kernel splices notification messages into pipes opened by user "
270 "space. The owner of the pipe has to tell the kernel which sources of events "
271 "to watch and filters can also be applied to select which subevents should be "
272 "placed into the pipe."
273 msgstr ""
274
275 #. type: SH
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 #, no-wrap
279 msgid "RETURN VALUE"
280 msgstr "VALOR DE RETORNO"
281
282 #. type: Plain text
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 #, fuzzy
286 #| msgid ""
287 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
288 #| "set appropriately."
289 msgid ""
290 "On success, zero is returned. On error, -1 is returned, I<errno> is set to "
291 "indicate the error, and I<pipefd> is left unchanged."
292 msgstr ""
293 "Em caso de successo, devolve 0. Caso contrário, -1 é devolvido e I<errno> é "
294 "selecionado adequadamente."
295
296 #. http://austingroupbugs.net/view.php?id=467
297 #. type: Plain text
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 msgid ""
301 "On Linux (and other systems), B<pipe>() does not modify I<pipefd> on "
302 "failure. A requirement standardizing this behavior was added in "
303 "POSIX.1-2008 TC2. The Linux-specific B<pipe2>() system call likewise does "
304 "not modify I<pipefd> on failure."
305 msgstr ""
306
307 #. type: SH
308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
310 #, no-wrap
311 msgid "ERRORS"
312 msgstr "ERROS"
313
314 #. type: TP
315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
317 #, no-wrap
318 msgid "B<EFAULT>"
319 msgstr "B<EFAULT>"
320
321 #. type: Plain text
322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
324 msgid "I<pipefd> is not valid."
325 msgstr "I<pipefd> não é válido."
326
327 #. type: TP
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 #, no-wrap
331 msgid "B<EINVAL>"
332 msgstr "B<EINVAL>"
333
334 #. type: Plain text
335 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
336 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
337 msgid "(B<pipe2>()) Invalid value in I<flags>."
338 msgstr ""
339
340 #. type: TP
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 #, no-wrap
344 msgid "B<EMFILE>"
345 msgstr "B<EMFILE>"
346
347 #. type: Plain text
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 msgid ""
351 "The per-process limit on the number of open file descriptors has been "
352 "reached."
353 msgstr ""
354 "O limite por processo no número de descritores de arquivo abertos foi "
355 "alcançado."
356
357 #. type: TP
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 #, no-wrap
361 msgid "B<ENFILE>"
362 msgstr "B<ENFILE>"
363
364 #. type: Plain text
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 msgid ""
368 "The system-wide limit on the total number of open files has been reached."
369 msgstr ""
370 "O limite para todo o sistema no número total de arquivos abertos foi "
371 "alcançado."
372
373 #. type: Plain text
374 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
375 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
376 msgid ""
377 "The user hard limit on memory that can be allocated for pipes has been "
378 "reached and the caller is not privileged; see B<pipe>(7)."
379 msgstr ""
380
381 #. type: TP
382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
384 #, no-wrap
385 msgid "B<ENOPKG>"
386 msgstr "B<ENOPKG>"
387
388 #. type: Plain text
389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
391 msgid ""
392 "(B<pipe2>()) B<O_NOTIFICATION_PIPE> was passed in I<flags> and support for "
393 "notifications (B<CONFIG_WATCH_QUEUE>) is not compiled into the kernel."
394 msgstr ""
395
396 #. type: SH
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 #, no-wrap
400 msgid "VERSIONS"
401 msgstr "VERSÕES"
402
403 #. See http://math-atlas.sourceforge.net/devel/assembly/64.psabi.1.33.ps.Z
404 #. for example, section 3.2.1 "Registers and the Stack Frame".
405 #. type: Plain text
406 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
407 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
408 msgid ""
409 "The System V ABI on some architectures allows the use of more than one "
410 "register for returning multiple values; several architectures (namely, "
411 "Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64) (ab)use this feature in "
412 "order to implement the B<pipe>() system call in a functional manner: the "
413 "call doesn't take any arguments and returns a pair of file descriptors as "
414 "the return value on success. The glibc B<pipe>() wrapper function "
415 "transparently deals with this. See B<syscall>(2) for information regarding "
416 "registers used for storing second file descriptor."
417 msgstr ""
418
419 #. type: SH
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "STANDARDS"
424 msgstr "PADRÕES"
425
426 #. type: Plain text
427 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
428 #: opensuse-tumbleweed
429 msgid "POSIX.1-2024."
430 msgstr "POSIX.1-2024."
431
432 #. type: SH
433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
435 #, no-wrap
436 msgid "HISTORY"
437 msgstr "HISTÓRICO"
438
439 #. type: TP
440 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
441 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
442 #, fuzzy, no-wrap
443 #| msgid "pipe"
444 msgid "B<pipe>()"
445 msgstr "pipe"
446
447 #. type: Plain text
448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
450 msgid "POSIX.1-2001."
451 msgstr "POSIX.1-2001."
452
453 #. type: TP
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 #, no-wrap
457 msgid "B<pipe2>()"
458 msgstr ""
459
460 #. type: Plain text
461 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
462 #: opensuse-tumbleweed
463 #, fuzzy
464 #| msgid "C99, POSIX.1-2001. glibc 2.1."
465 msgid "POSIX.1-2024. Linux 2.6.27, glibc 2.9."
466 msgstr "C99, POSIX.1-2001. glibc 2.1."
467
468 #. type: SH
469 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
470 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
471 #, no-wrap
472 msgid "EXAMPLES"
473 msgstr "EXEMPLOS"
474
475 #. fork.2 refers to this example program.
476 #. type: Plain text
477 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
478 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
479 msgid ""
480 "The following program creates a pipe, and then B<fork>(2)s to create a child "
481 "process; the child inherits a duplicate set of file descriptors that refer "
482 "to the same pipe. After the B<fork>(2), each process closes the file "
483 "descriptors that it doesn't need for the pipe (see B<pipe>(7)). The parent "
484 "then writes the string contained in the program's command-line argument to "
485 "the pipe, and the child reads this string a byte at a time from the pipe and "
486 "echoes it on standard output."
487 msgstr ""
488
489 #. type: SS
490 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
491 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
492 #, no-wrap
493 msgid "Program source"
494 msgstr "Fonte do programa"
495
496 #. type: Plain text
497 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
498 #: opensuse-leap-16-1 opensuse-tumbleweed
499 #, no-wrap
500 msgid ""
501 "#include E<lt>err.hE<gt>\n"
502 "#include E<lt>stdio.hE<gt>\n"
503 "#include E<lt>stdlib.hE<gt>\n"
504 "#include E<lt>string.hE<gt>\n"
505 "#include E<lt>sys/types.hE<gt>\n"
506 "#include E<lt>sys/wait.hE<gt>\n"
507 "#include E<lt>unistd.hE<gt>\n"
508 "\\&\n"
509 "int\n"
510 "main(int argc, char *argv[])\n"
511 "{\n"
512 " int pipefd[2];\n"
513 " char buf;\n"
514 " pid_t cpid;\n"
515 "\\&\n"
516 " if (argc != 2) {\n"
517 " fprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\[rs]n\", argv[0]);\n"
518 " exit(EXIT_FAILURE);\n"
519 " }\n"
520 "\\&\n"
521 " if (pipe(pipefd) == -1)\n"
522 " err(EXIT_FAILURE, \"pipe\");\n"
523 "\\&\n"
524 " cpid = fork();\n"
525 " if (cpid == -1)\n"
526 " err(EXIT_FAILURE, \"fork\");\n"
527 "\\&\n"
528 " if (cpid == 0) { /* Child reads from pipe */\n"
529 " if (close(pipefd[1]) == -1) /* Close unused write end */\n"
530 " err(EXIT_FAILURE, \"close\");\n"
531 "\\&\n"
532 " while (read(pipefd[0], &buf, 1) E<gt> 0) {\n"
533 " if (write(STDOUT_FILENO, &buf, 1) != 1)\n"
534 " err(EXIT_FAILURE, \"write\");\n"
535 " }\n"
536 "\\&\n"
537 " if (write(STDOUT_FILENO, \"\\[rs]n\", 1) != 1)\n"
538 " err(EXIT_FAILURE, \"write\");\n"
539 " if (close(pipefd[0]) == -1)\n"
540 " err(EXIT_FAILURE, \"close\");\n"
541 " _exit(EXIT_SUCCESS);\n"
542 "\\&\n"
543 " } else { /* Parent writes argv[1] to pipe */\n"
544 " if (close(pipefd[0]) == -1) /* Close unused read end */\n"
545 " err(EXIT_FAILURE, \"close\");\n"
546 " if (write(pipefd[1], argv[1], strlen(argv[1])) != strlen(argv[1]))\n"
547 " err(EXIT_FAILURE, \"write\");\n"
548 " if (close(pipefd[1]) == -1) /* Reader will see EOF */\n"
549 " err(EXIT_FAILURE, \"close\");\n"
550 " if (wait(NULL) == -1) /* Wait for child */\n"
551 " err(EXIT_FAILURE, \"wait\");\n"
552 " exit(EXIT_SUCCESS);\n"
553 " }\n"
554 "}\n"
555 msgstr ""
556
557 #. SRC END
558 #. type: SH
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 #, no-wrap
562 msgid "SEE ALSO"
563 msgstr "VEJA TAMBÉM"
564
565 #. type: Plain text
566 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
567 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
568 msgid ""
569 "B<fork>(2), B<read>(2), B<socketpair>(2), B<splice>(2), B<tee>(2), "
570 "B<vmsplice>(2), B<write>(2), B<popen>(3), B<pipe>(7)"
571 msgstr ""
572 "B<fork>(2), B<read>(2), B<socketpair>(2), B<splice>(2), B<tee>(2), "
573 "B<vmsplice>(2), B<write>(2), B<popen>(3), B<pipe>(7)"
574
575 #. type: TH
576 #: debian-trixie
577 #, no-wrap
578 msgid "2024-06-15"
579 msgstr "15 junho 2024"
580
581 #. type: TH
582 #: debian-trixie
583 #, no-wrap
584 msgid "Linux man-pages 6.9.1"
585 msgstr "Linux man-pages 6.9.1"
586
587 #. type: Plain text
588 #: debian-trixie
589 msgid "Standard C library (I<libc>, I<-lc>)"
590 msgstr "Biblioteca C Padrão (I<libc>, I<-lc>)"
591
592 #. type: Plain text
593 #: debian-trixie fedora-44 fedora-rawhide
594 msgid "POSIX.1-2008."
595 msgstr "POSIX.1-2008."
596
597 #. type: Plain text
598 #: debian-trixie fedora-44 fedora-rawhide
599 msgid "Linux."
600 msgstr "Linux."
601
602 #. type: Plain text
603 #: debian-trixie fedora-44 fedora-rawhide
604 msgid "Linux 2.6.27, glibc 2.9."
605 msgstr "Linux 2.6.27, glibc 2.9."
606
607 #. type: Plain text
608 #: debian-trixie
609 #, no-wrap
610 msgid ""
611 "#include E<lt>stdio.hE<gt>\n"
612 "#include E<lt>stdlib.hE<gt>\n"
613 "#include E<lt>string.hE<gt>\n"
614 "#include E<lt>sys/types.hE<gt>\n"
615 "#include E<lt>sys/wait.hE<gt>\n"
616 "#include E<lt>unistd.hE<gt>\n"
617 "\\&\n"
618 "int\n"
619 "main(int argc, char *argv[])\n"
620 "{\n"
621 " int pipefd[2];\n"
622 " char buf;\n"
623 " pid_t cpid;\n"
624 "\\&\n"
625 " if (argc != 2) {\n"
626 " fprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\[rs]n\", argv[0]);\n"
627 " exit(EXIT_FAILURE);\n"
628 " }\n"
629 "\\&\n"
630 " if (pipe(pipefd) == -1) {\n"
631 " perror(\"pipe\");\n"
632 " exit(EXIT_FAILURE);\n"
633 " }\n"
634 "\\&\n"
635 " cpid = fork();\n"
636 " if (cpid == -1) {\n"
637 " perror(\"fork\");\n"
638 " exit(EXIT_FAILURE);\n"
639 " }\n"
640 "\\&\n"
641 " if (cpid == 0) { /* Child reads from pipe */\n"
642 " close(pipefd[1]); /* Close unused write end */\n"
643 "\\&\n"
644 " while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
645 " write(STDOUT_FILENO, &buf, 1);\n"
646 "\\&\n"
647 " write(STDOUT_FILENO, \"\\[rs]n\", 1);\n"
648 " close(pipefd[0]);\n"
649 " _exit(EXIT_SUCCESS);\n"
650 "\\&\n"
651 " } else { /* Parent writes argv[1] to pipe */\n"
652 " close(pipefd[0]); /* Close unused read end */\n"
653 " write(pipefd[1], argv[1], strlen(argv[1]));\n"
654 " close(pipefd[1]); /* Reader will see EOF */\n"
655 " wait(NULL); /* Wait for child */\n"
656 " exit(EXIT_SUCCESS);\n"
657 " }\n"
658 "}\n"
659 msgstr ""
660
661 #. type: TH
662 #: fedora-44 fedora-rawhide
663 #, no-wrap
664 msgid "2024-07-23"
665 msgstr "23 julho 2024"
666
667 #. type: TH
668 #: fedora-44 fedora-rawhide
669 #, no-wrap
670 msgid "Linux man-pages 6.13"
671 msgstr "Linux man-pages 6.13"
672
673 #. type: TH
674 #: mageia-cauldron
675 #, no-wrap
676 msgid "Linux man-pages 6.17"
677 msgstr "Linux man-pages 6.17"
678
679 #. type: TH
680 #: opensuse-leap-16-1 opensuse-tumbleweed
681 #, no-wrap
682 msgid "Linux man-pages (unreleased)"
683 msgstr "Linux man-pages (não lançado)"