Debian Codegraph @

po/pt_BR/man2/select.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 # Mila <[email protected]>, 2001.
5 # André Luiz Fassone <[email protected]>, 2001.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
10 "PO-Revision-Date: 2001-06-02 19:20-0300\n"
11 "Last-Translator: André Luiz Fassone <[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 "select"
26 msgstr "select"
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 #, fuzzy
53 #| msgid ""
54 #| "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
55 #| "multiplexing"
56 msgid ""
57 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO, fd_set - synchronous I/O "
58 "multiplexing"
59 msgstr ""
60 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - multiplexação síncrono "
61 "de E/S"
62
63 #. type: SH
64 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
65 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
66 #, no-wrap
67 msgid "LIBRARY"
68 msgstr "BIBLIOTECA"
69
70 #. type: Plain text
71 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
72 #: opensuse-leap-16-1 opensuse-tumbleweed
73 msgid "Standard C library (I<libc>,\\ I<-lc>)"
74 msgstr "Biblioteca C Padrão (I<libc>,\\ I<-lc>)"
75
76 #. type: SH
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "SYNOPSIS"
81 msgstr "SINOPSE"
82
83 #. type: Plain text
84 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
85 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
86 #, no-wrap
87 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
88 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
89
90 #. type: Plain text
91 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
92 #: opensuse-tumbleweed
93 #, no-wrap
94 msgid "B<typedef> /* .\\|.\\|.\\& */ B<fd_set;>\n"
95 msgstr ""
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, fuzzy, no-wrap
101 #| msgid ""
102 #| "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
103 #| "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
104 msgid ""
105 "B<int select(int >I<nfds>B<, fd_set *_Nullable restrict >I<readfds>B<,>\n"
106 "B< fd_set *_Nullable restrict >I<writefds>B<,>\n"
107 "B< fd_set *_Nullable restrict >I<exceptfds>B<,>\n"
108 "B< struct timeval *_Nullable restrict >I<timeout>B<);>\n"
109 msgstr ""
110 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
111 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
112
113 #. type: Plain text
114 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
115 #: opensuse-tumbleweed
116 #, fuzzy, no-wrap
117 #| msgid ""
118 #| "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
119 #| "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
120 #| "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
121 #| "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
122 msgid ""
123 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
124 "B<int FD_ISSET(int >I<fd>B<, const fd_set *>I<set>B<);>\n"
125 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
126 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
127 msgstr ""
128 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
129 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
130 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
131 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
132
133 #. type: Plain text
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 #, fuzzy, no-wrap
137 #| msgid ""
138 #| "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
139 #| "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
140 #| "B< const sigset_t *>I<sigmask>B<);>\n"
141 msgid ""
142 "B<int pselect(int >I<nfds>B<, fd_set *_Nullable restrict >I<readfds>B<,>\n"
143 "B< fd_set *_Nullable restrict >I<writefds>B<,>\n"
144 "B< fd_set *_Nullable restrict >I<exceptfds>B<,>\n"
145 "B< const struct timespec *_Nullable restrict >I<timeout>B<,>\n"
146 "B< const sigset_t *_Nullable restrict >I<sigmask>B<);>\n"
147 msgstr ""
148 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
149 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
150 "B< const sigset_t *>I<sigmask>B<);>\n"
151
152 #. type: Plain text
153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
155 msgid ""
156 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
157 msgstr ""
158 "Requisitos de macro de teste de recursos para o glibc (consulte "
159 "B<feature_test_macros>(7)):"
160
161 #. type: Plain text
162 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
163 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
164 #, fuzzy
165 #| msgid "pselect()"
166 msgid "B<pselect>():"
167 msgstr "pselect()"
168
169 #. type: Plain text
170 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
171 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
172 #, no-wrap
173 msgid " _POSIX_C_SOURCE E<gt>= 200112L\n"
174 msgstr " _POSIX_C_SOURCE E<gt>= 200112L\n"
175
176 #. type: SH
177 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
178 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
179 #, no-wrap
180 msgid "DESCRIPTION"
181 msgstr "DESCRIÇÃO"
182
183 #. type: Plain text
184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
186 msgid ""
187 "B<WARNING>: B<select>() can monitor only file descriptors numbers that are "
188 "less than B<FD_SETSIZE> (1024)\\[em]an unreasonably low limit for many "
189 "modern applications\\[em]and this limitation will not change. All modern "
190 "applications should instead use B<poll>(2) or B<epoll>(7), which do not "
191 "suffer this limitation."
192 msgstr ""
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 msgid ""
198 "B<select>() allows a program to monitor multiple file descriptors, waiting "
199 "until one or more of the file descriptors become \"ready\" for some class of "
200 "I/O operation (e.g., input possible). A file descriptor is considered ready "
201 "if it is possible to perform a corresponding I/O operation (e.g., "
202 "B<read>(2), or a sufficiently small B<write>(2)) without blocking."
203 msgstr ""
204
205 #. type: SS
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 #, no-wrap
209 msgid "fd_set"
210 msgstr ""
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 "A structure type that can represent a set of file descriptors. According to "
217 "POSIX, the maximum number of file descriptors in an I<fd_set> structure is "
218 "the value of the macro B<FD_SETSIZE>."
219 msgstr ""
220
221 #. type: SS
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 #, no-wrap
225 msgid "File descriptor sets"
226 msgstr ""
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 msgid ""
232 "The principal arguments of B<select>() are three \"sets\" of file "
233 "descriptors (declared with the type I<fd_set>), which allow the caller to "
234 "wait for three classes of events on the specified set of file descriptors. "
235 "Each of the I<fd_set> arguments may be specified as NULL if no file "
236 "descriptors are to be watched for the corresponding class of events."
237 msgstr ""
238
239 #. type: Plain text
240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
242 msgid ""
243 "B<Note well>: Upon return, each of the file descriptor sets is modified in "
244 "place to indicate which file descriptors are currently \"ready\". Thus, if "
245 "using B<select>() within a loop, the sets I<must be reinitialized> before "
246 "each call."
247 msgstr ""
248
249 #. type: Plain text
250 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
251 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
252 msgid ""
253 "The contents of a file descriptor set can be manipulated using the following "
254 "macros:"
255 msgstr ""
256
257 #. type: TP
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 #, no-wrap
261 msgid "B<FD_ZERO>()"
262 msgstr "B<FD_ZERO>()"
263
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 "This macro clears (removes all file descriptors from) I<set>. It should be "
269 "employed as the first step in initializing a file descriptor set."
270 msgstr ""
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<FD_SET>()"
277 msgstr "B<FD_SET>()"
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 ""
283 "This macro adds the file descriptor I<fd> to I<set>. Adding a file "
284 "descriptor that is already present in the set is a no-op, and does not "
285 "produce an error."
286 msgstr ""
287
288 #. type: TP
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 #, no-wrap
292 msgid "B<FD_CLR>()"
293 msgstr "B<FD_CLR>()"
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid ""
299 "This macro removes the file descriptor I<fd> from I<set>. Removing a file "
300 "descriptor that is not present in the set is a no-op, and does not produce "
301 "an error."
302 msgstr ""
303
304 #. type: TP
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid "B<FD_ISSET>()"
309 msgstr "B<FD_ISSET>()"
310
311 #. type: Plain text
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 msgid ""
315 "B<select>() modifies the contents of the sets according to the rules "
316 "described below. After calling B<select>(), the B<FD_ISSET>() macro can be "
317 "used to test if a file descriptor is still present in a set. B<FD_ISSET>() "
318 "returns nonzero if the file descriptor I<fd> is present in I<set>, and zero "
319 "if it is not."
320 msgstr ""
321
322 #. type: SS
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 #, no-wrap
326 msgid "Arguments"
327 msgstr "Argumentos"
328
329 #. type: Plain text
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 msgid "The arguments of B<select>() are as follows:"
333 msgstr ""
334
335 #. type: TP
336 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
337 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
338 #, no-wrap
339 msgid "I<readfds>"
340 msgstr "I<readfds>"
341
342 #. type: Plain text
343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
345 msgid ""
346 "The file descriptors in this set are watched to see if they are ready for "
347 "reading. A file descriptor is ready for reading if a read operation will "
348 "not block; in particular, a file descriptor is also ready on end-of-file."
349 msgstr ""
350
351 #. type: Plain text
352 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
353 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
354 msgid ""
355 "After B<select>() has returned, I<readfds> will be cleared of all file "
356 "descriptors except for those that are ready for reading."
357 msgstr ""
358
359 #. type: TP
360 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
361 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
362 #, no-wrap
363 msgid "I<writefds>"
364 msgstr "I<writefds>"
365
366 #. type: Plain text
367 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
368 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
369 msgid ""
370 "The file descriptors in this set are watched to see if they are ready for "
371 "writing. A file descriptor is ready for writing if a write operation will "
372 "not block. However, even if a file descriptor indicates as writable, a "
373 "large write may still block."
374 msgstr ""
375
376 #. type: Plain text
377 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
378 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
379 msgid ""
380 "After B<select>() has returned, I<writefds> will be cleared of all file "
381 "descriptors except for those that are ready for writing."
382 msgstr ""
383
384 #. type: TP
385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
387 #, no-wrap
388 msgid "I<exceptfds>"
389 msgstr "I<exceptfds>"
390
391 #. type: Plain text
392 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
393 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
394 msgid ""
395 "The file descriptors in this set are watched for \"exceptional "
396 "conditions\". For examples of some exceptional conditions, see the "
397 "discussion of B<POLLPRI> in B<poll>(2)."
398 msgstr ""
399
400 #. type: Plain text
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 msgid ""
404 "After B<select>() has returned, I<exceptfds> will be cleared of all file "
405 "descriptors except for those for which an exceptional condition has occurred."
406 msgstr ""
407
408 #. type: TP
409 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
410 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
411 #, no-wrap
412 msgid "I<nfds>"
413 msgstr "I<nfds>"
414
415 #. type: Plain text
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 msgid ""
419 "This argument should be set to the highest-numbered file descriptor in any "
420 "of the three sets, plus 1. The indicated file descriptors in each set are "
421 "checked, up to this limit (but see BUGS)."
422 msgstr ""
423
424 #. type: TP
425 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
426 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
427 #, no-wrap
428 msgid "I<timeout>"
429 msgstr "I<timeout>"
430
431 #. type: Plain text
432 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
433 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
434 msgid ""
435 "The I<timeout> argument is a I<timeval> structure (shown below) that "
436 "specifies the interval that B<select>() should block waiting for a file "
437 "descriptor to become ready. The call will block until either:"
438 msgstr ""
439
440 #. type: IP
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 #, no-wrap
444 msgid "\\[bu]"
445 msgstr "\\[bu]"
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 #, fuzzy
451 #| msgid "The field descriptions are:"
452 msgid "a file descriptor becomes ready;"
453 msgstr "As descrições dos campos são:"
454
455 #. type: Plain text
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 msgid "the call is interrupted by a signal handler; or"
459 msgstr ""
460
461 #. type: Plain text
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 msgid "the timeout expires."
465 msgstr ""
466
467 #. type: Plain text
468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
470 msgid ""
471 "Note that the I<timeout> interval will be rounded up to the system clock "
472 "granularity, and kernel scheduling delays mean that the blocking interval "
473 "may overrun by a small amount."
474 msgstr ""
475
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 "If both fields of the I<timeval> structure are zero, then B<select>() "
481 "returns immediately. (This is useful for polling.)"
482 msgstr ""
483
484 #. type: Plain text
485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
487 msgid ""
488 "If I<timeout> is specified as NULL, B<select>() blocks indefinitely waiting "
489 "for a file descriptor to become ready."
490 msgstr ""
491
492 #. type: SS
493 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
494 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
495 #, no-wrap
496 msgid "pselect()"
497 msgstr "pselect()"
498
499 #. type: Plain text
500 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
501 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
502 msgid ""
503 "The B<pselect>() system call allows an application to safely wait until "
504 "either a file descriptor becomes ready or until a signal is caught."
505 msgstr ""
506
507 #. type: Plain text
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 #, fuzzy
511 #| msgid "Their function is identical, with three differences:"
512 msgid ""
513 "The operation of B<select>() and B<pselect>() is identical, other than "
514 "these three differences:"
515 msgstr "Suas funções são idênticas, com três diferenças:"
516
517 #. type: Plain text
518 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
519 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
520 #, fuzzy
521 #| msgid ""
522 #| "The B<select> function uses a timeout that is a I<struct timeval> (with "
523 #| "seconds and microseconds), while B<pselect> uses a I<struct timespec> "
524 #| "(with seconds and nanoseconds)."
525 msgid ""
526 "B<select>() uses a timeout that is a I<struct timeval> (with seconds and "
527 "microseconds), while B<pselect>() uses a I<struct timespec> (with seconds "
528 "and nanoseconds)."
529 msgstr ""
530 "A função B<select> usa um tempo de espera que é uma I<struct timeval> (com "
531 "segundos e microsegundos), enquanto B<pselect> usa uma I<struct timespec> "
532 "(com segundos e nanosegundos)."
533
534 #. type: Plain text
535 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
536 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
537 #, fuzzy
538 #| msgid ""
539 #| "The B<select> function may update the I<timeout> parameter to indicate "
540 #| "how much time was left. The B<pselect> function does not change this "
541 #| "parameter."
542 msgid ""
543 "B<select>() may update the I<timeout> argument to indicate how much time "
544 "was left. B<pselect>() does not change this argument."
545 msgstr ""
546 "A função B<select> pode atualizar o parâmetro I<timeout> para indicar quanto "
547 "tempo resta. A função B<pselect> não muda esse parâmetro."
548
549 #. type: Plain text
550 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
551 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
552 #, fuzzy
553 #| msgid ""
554 #| "The B<select> function has no I<sigmask> parameter, and behaves as "
555 #| "B<pselect> called with NULL I<sigmask>."
556 msgid ""
557 "B<select>() has no I<sigmask> argument, and behaves as B<pselect>() called "
558 "with NULL I<sigmask>."
559 msgstr ""
560 "A função B<select> não tem parâmetro I<sigmask> e funciona como B<pselect> "
561 "chamado com I<sigmask> NULO."
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 #, fuzzy
567 #| msgid ""
568 #| "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it "
569 #| "is not NULL, then B<pselect> first replaces the current signal mask by "
570 #| "the one pointed to by I<sigmask>, then does the `select' function, and "
571 #| "then restores the original signal mask again."
572 msgid ""
573 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
574 "not NULL, then B<pselect>() first replaces the current signal mask by the "
575 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
576 "restores the original signal mask. (If I<sigmask> is NULL, the signal mask "
577 "is not modified during the B<pselect>() call.)"
578 msgstr ""
579 "I<sigmask> é um ponteiro para uma máscara de sinal (veja B<sigprocmask>(2)); "
580 "se ele não é NULO, então B<pselect> primeiro substitui a máscara de sinal "
581 "atual pela apontada por I<sigmask>, e aciona a função `select', e então "
582 "restaura novamente a máscara de sinal original."
583
584 #. type: Plain text
585 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
586 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
587 msgid ""
588 "Other than the difference in the precision of the I<timeout> argument, the "
589 "following B<pselect>() call:"
590 msgstr ""
591
592 #. type: Plain text
593 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
594 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
595 #, no-wrap
596 msgid ""
597 "ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
598 " timeout, &sigmask);\n"
599 msgstr ""
600 "ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
601 " timeout, &sigmask);\n"
602
603 #. type: Plain text
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 msgid "is equivalent to I<atomically> executing the following calls:"
607 msgstr ""
608
609 #. type: Plain text
610 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
611 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
612 #, fuzzy, no-wrap
613 #| msgid ""
614 #| "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
615 #| "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
616 #| "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
617 msgid ""
618 "sigset_t origmask;\n"
619 "\\&\n"
620 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
621 "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
622 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
623 msgstr ""
624 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
625 "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
626 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 #, fuzzy
632 #| msgid ""
633 #| "The idea of B<pselect> is that if one wants to wait for an event, either "
634 #| "a signal or something on a file descriptor, an atomic test is needed to "
635 #| "prevent race conditions. (Suppose the signal handler sets a global flag "
636 #| "and returns. Then a test of this global flag followed by a call of "
637 #| "B<select>() could hang indefinitely if the signal arrived just after the "
638 #| "test but just before the call. On the other hand, B<pselect> allows one "
639 #| "to first block signals, handle the signals that have come in, then call "
640 #| "B<pselect>() with the desired I<sigmask>, avoiding the race.) Since "
641 #| "Linux today does not have a I<pselect>() system call, the current glibc2 "
642 #| "routine still contains this race."
643 msgid ""
644 "The reason that B<pselect>() is needed is that if one wants to wait for "
645 "either a signal or for a file descriptor to become ready, then an atomic "
646 "test is needed to prevent race conditions. (Suppose the signal handler sets "
647 "a global flag and returns. Then a test of this global flag followed by a "
648 "call of B<select>() could hang indefinitely if the signal arrived just "
649 "after the test but just before the call. By contrast, B<pselect>() allows "
650 "one to first block signals, handle the signals that have come in, then call "
651 "B<pselect>() with the desired I<sigmask>, avoiding the race.)"
652 msgstr ""
653 "A idéia do B<pselect> é de que caso se deseje aguardar por um evento, ou um "
654 "sinal ou algo em um descritor de arquivos, o teste atômico é necessário para "
655 "prevenir 'race conditions'. (Suponha que o manipulador de sinais defina um "
656 "sinalizador global e retorne. Então um teste deste sinalizador global "
657 "seguido de uma chamada de B<select>() poderia travar indefinidamente se o "
658 "sinal chegou logo após o teste mas antes da chamada. De outro lado, "
659 "B<pselect> permite primeiro bloquear os sinais, manipular os sinais que "
660 "chegam, e então chamar B<pselect>() com a I<sigmask>, desejada evitando a "
661 "'race'.) Como Linux hoje não apresenta uma chamada de sistema, I<pselect>() "
662 "a rotina glibc2 atual ainda contém esta 'race'."
663
664 #. type: SS
665 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
666 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
667 #, no-wrap
668 msgid "The timeout"
669 msgstr ""
670
671 #. type: Plain text
672 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
673 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
674 msgid ""
675 "The I<timeout> argument for B<select>() is a structure of the following "
676 "type:"
677 msgstr ""
678
679 #. type: Plain text
680 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
681 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
682 #, no-wrap
683 msgid ""
684 "struct timeval {\n"
685 " time_t tv_sec; /* seconds */\n"
686 " suseconds_t tv_usec; /* microseconds */\n"
687 "};\n"
688 msgstr ""
689 "struct timeval {\n"
690 " time_t tv_sec; /* segundos */\n"
691 " suseconds_t tv_usec; /* microsegundos */\n"
692 "};\n"
693
694 #. type: Plain text
695 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
696 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
697 msgid ""
698 "The corresponding argument for B<pselect>() is a B<timespec>(3) structure."
699 msgstr ""
700
701 #. .P - it is rumored that:
702 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
703 #. - it is certainly true that:
704 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
705 #. type: Plain text
706 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
707 #: opensuse-tumbleweed
708 #, fuzzy
709 #| msgid ""
710 #| "On Linux, I<timeout> is modified to reflect the amount of time not slept; "
711 #| "most other implementations do not do this. This causes problems both "
712 #| "when Linux code which reads I<timeout> is ported to other operating "
713 #| "systems, and when code is ported to Linux that reuses a struct timeval "
714 #| "for multiple B<select>s in a loop without reinitializing it. Consider "
715 #| "I<timeout> to be undefined after B<select> returns."
716 msgid ""
717 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
718 "slept; most other implementations do not do this. (POSIX.1 permits either "
719 "behavior.) This causes problems both when Linux code which reads I<timeout> "
720 "is ported to other operating systems, and when code is ported to Linux that "
721 "reuses a I<struct\\ timeval> for multiple B<select>()s in a loop without "
722 "reinitializing it. Consider I<timeout> to be undefined after B<select>() "
723 "returns."
724 msgstr ""
725 "No Linux, I<timeout> é modificado para refletir a quantidade de tempo não "
726 "inativo; a maior parte das outras implementações não faz isto. Isto causa "
727 "problemas quando um código Linux que interpreta I<timeout> é portado para "
728 "outro sistema operacional, e quando código portado para Linux reutiliza uma "
729 "struct timeval para múltiplos B<select>s em loop sem reinicializá-lo. "
730 "Considere I<timeout> indefinido após o retorno de B<select>."
731
732 #. type: SH
733 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
734 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
735 #, no-wrap
736 msgid "RETURN VALUE"
737 msgstr "VALOR DE RETORNO"
738
739 #. type: Plain text
740 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
741 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
742 msgid ""
743 "On success, B<select>() and B<pselect>() return the number of file "
744 "descriptors contained in the three returned descriptor sets (that is, the "
745 "total number of bits that are set in I<readfds>, I<writefds>, "
746 "I<exceptfds>). The return value may be zero if the timeout expired before "
747 "any file descriptors became ready."
748 msgstr ""
749
750 #. type: Plain text
751 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
752 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
753 msgid ""
754 "On error, -1 is returned, and I<errno> is set to indicate the error; the "
755 "file descriptor sets are unmodified, and I<timeout> becomes undefined."
756 msgstr ""
757
758 #. type: SH
759 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
760 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
761 #, no-wrap
762 msgid "ERRORS"
763 msgstr "ERROS"
764
765 #. type: TP
766 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
767 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
768 #, no-wrap
769 msgid "B<EBADF>"
770 msgstr "B<EBADF>"
771
772 #. type: Plain text
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 msgid ""
776 "An invalid file descriptor was given in one of the sets. (Perhaps a file "
777 "descriptor that was already closed, or one on which an error has occurred.) "
778 "However, see BUGS."
779 msgstr ""
780
781 #. type: TP
782 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
783 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
784 #, no-wrap
785 msgid "B<EINTR>"
786 msgstr "B<EINTR>"
787
788 #. type: Plain text
789 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
790 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
791 msgid "A signal was caught; see B<signal>(7)."
792 msgstr ""
793
794 #. type: TP
795 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
796 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
797 #, no-wrap
798 msgid "B<EINVAL>"
799 msgstr "B<EINVAL>"
800
801 #. type: Plain text
802 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
803 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
804 msgid ""
805 "I<nfds> is negative or exceeds the B<RLIMIT_NOFILE> resource limit (see "
806 "B<getrlimit>(2))."
807 msgstr ""
808
809 #. type: Plain text
810 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
811 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
812 msgid "The value contained within I<timeout> is invalid."
813 msgstr ""
814
815 #. type: TP
816 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
817 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
818 #, no-wrap
819 msgid "B<ENOMEM>"
820 msgstr "B<ENOMEM>"
821
822 #. type: Plain text
823 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
824 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
825 #, fuzzy
826 #| msgid "B<select> was unable to allocate memory for internal tables."
827 msgid "Unable to allocate memory for internal tables."
828 msgstr "B<select> não foi capaz de alocar memória para tabelas internas."
829
830 #. type: SH
831 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
832 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
833 #, no-wrap
834 msgid "VERSIONS"
835 msgstr "VERSÕES"
836
837 #. Darwin, according to a report by Jeremy Sequoia, relayed by Josh Triplett
838 #. type: Plain text
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 msgid ""
842 "On some other UNIX systems, B<select>() can fail with the error B<EAGAIN> "
843 "if the system fails to allocate kernel-internal resources, rather than "
844 "B<ENOMEM> as Linux does. POSIX specifies this error for B<poll>(2), but not "
845 "for B<select>(). Portable programs may wish to check for B<EAGAIN> and "
846 "loop, just as with B<EINTR>."
847 msgstr ""
848
849 #. type: SH
850 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
851 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
852 #, no-wrap
853 msgid "STANDARDS"
854 msgstr "PADRÕES"
855
856 #. type: Plain text
857 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
858 #: opensuse-tumbleweed
859 msgid "POSIX.1-2024."
860 msgstr "POSIX.1-2024."
861
862 #. type: SH
863 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
864 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
865 #, no-wrap
866 msgid "HISTORY"
867 msgstr "HISTÓRICO"
868
869 #. type: TP
870 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
871 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
872 #, fuzzy, no-wrap
873 #| msgid "pselect()"
874 msgid "B<select>()"
875 msgstr "pselect()"
876
877 #. type: Plain text
878 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
879 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
880 msgid "POSIX.1-2001, 4.4BSD (first appeared in 4.2BSD)."
881 msgstr "POSIX.1-2001, 4.4BSD (apareceu pela primeira vez no 4.2BSD)."
882
883 #. type: Plain text
884 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
885 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
886 #, fuzzy
887 #| msgid ""
888 #| "4.4BSD (the B<select> function first appeared in 4.2BSD). Generally "
889 #| "portable to/from non-BSD systems supporting clones of the BSD socket "
890 #| "layer (including System V variants). However, note that the System V "
891 #| "variant typically sets the timeout variable before exit, but the BSD "
892 #| "variant does not."
893 msgid ""
894 "Generally portable to/from non-BSD systems supporting clones of the BSD "
895 "socket layer (including System\\ V variants). However, note that the "
896 "System\\ V variant typically sets the timeout variable before returning, but "
897 "the BSD variant does not."
898 msgstr ""
899 "BSD 4.4 (a função B<select> surgiu no BSD 4.2). Geralmente portável de/para "
900 "sistemas não-BSD com suporte a clones da camada de 'socket' BSD (incluindo "
901 "variações do System V). No entanto, note que o variante de System V "
902 "tipicamente define a variável de tempo de espera antes de sair, mas o "
903 "variante de BSD não."
904
905 #. type: TP
906 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
907 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
908 #, fuzzy, no-wrap
909 #| msgid "pselect()"
910 msgid "B<pselect>()"
911 msgstr "pselect()"
912
913 #. type: Plain text
914 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
915 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
916 #, fuzzy
917 #| msgid "glibc 2.1. C99, POSIX.1-2001."
918 msgid "Linux 2.6.16. POSIX.1g, POSIX.1-2001."
919 msgstr "glibc 2.1. C99, POSIX.1-2001."
920
921 #. type: Plain text
922 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
923 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
924 msgid "Prior to this, it was emulated in glibc (but see BUGS)."
925 msgstr ""
926
927 #. type: TP
928 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
929 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
930 #, fuzzy, no-wrap
931 #| msgid "I<offset>"
932 msgid "B<fd_set>"
933 msgstr "I<offset>"
934
935 #. type: Plain text
936 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
937 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
938 msgid "POSIX.1-2001."
939 msgstr "POSIX.1-2001."
940
941 #. type: SH
942 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
943 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
944 #, no-wrap
945 msgid "NOTES"
946 msgstr "NOTAS"
947
948 #. type: Plain text
949 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
950 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
951 msgid ""
952 "The following header also provides the I<fd_set> type: I<E<lt>sys/"
953 "time.hE<gt>>."
954 msgstr ""
955
956 #. type: Plain text
957 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
958 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
959 msgid ""
960 "An I<fd_set> is a fixed size buffer. Executing B<FD_CLR>() or B<FD_SET>() "
961 "with a value of I<fd> that is negative or is equal to or larger than "
962 "B<FD_SETSIZE> will result in undefined behavior. Moreover, POSIX requires "
963 "I<fd> to be a valid file descriptor."
964 msgstr ""
965
966 #. type: Plain text
967 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
968 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
969 msgid ""
970 "The operation of B<select>() and B<pselect>() is not affected by the "
971 "B<O_NONBLOCK> flag."
972 msgstr ""
973
974 #. type: SS
975 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
976 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
977 #, no-wrap
978 msgid "The self-pipe trick"
979 msgstr ""
980
981 #. type: Plain text
982 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
983 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
984 msgid ""
985 "On systems that lack B<pselect>(), reliable (and more portable) signal "
986 "trapping can be achieved using the self-pipe trick. In this technique, a "
987 "signal handler writes a byte to a pipe whose other end is monitored by "
988 "B<select>() in the main program. (To avoid possibly blocking when writing "
989 "to a pipe that may be full or reading from a pipe that may be empty, "
990 "nonblocking I/O is used when reading from and writing to the pipe.)"
991 msgstr ""
992
993 #. type: SS
994 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
995 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
996 #, no-wrap
997 msgid "Emulating usleep(3)"
998 msgstr ""
999
1000 #. type: Plain text
1001 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1002 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1003 #, fuzzy
1004 #| msgid ""
1005 #| "Some code calls B<select> with all three sets empty, I<n> zero, and a non-"
1006 #| "null I<timeout> as a fairly portable way to sleep with subsecond "
1007 #| "precision."
1008 msgid ""
1009 "Before the advent of B<usleep>(3), some code employed a call to B<select>() "
1010 "with all three sets empty, I<nfds> zero, and a non-NULL I<timeout> as a "
1011 "fairly portable way to sleep with subsecond precision."
1012 msgstr ""
1013 "Algum código chamou B<select> com os três conjuntos vazios, I<n> zero, e um "
1014 "I<timeout> não-nulo, como uma certa forma de desativar com precisão de "
1015 "subsegundo."
1016
1017 #. type: SS
1018 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1019 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1020 #, no-wrap
1021 msgid "Correspondence between select() and poll() notifications"
1022 msgstr ""
1023
1024 #. fs/select.c
1025 #. type: Plain text
1026 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1027 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1028 msgid ""
1029 "Within the Linux kernel source, we find the following definitions which show "
1030 "the correspondence between the readable, writable, and exceptional condition "
1031 "notifications of B<select>() and the event notifications provided by "
1032 "B<poll>(2) and B<epoll>(7):"
1033 msgstr ""
1034
1035 #. type: Plain text
1036 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1037 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1038 #, no-wrap
1039 msgid ""
1040 "#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |\n"
1041 " EPOLLHUP | EPOLLERR)\n"
1042 " /* Ready for reading */\n"
1043 "#define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT |\n"
1044 " EPOLLERR)\n"
1045 " /* Ready for writing */\n"
1046 "#define POLLEX_SET (EPOLLPRI)\n"
1047 " /* Exceptional condition */\n"
1048 msgstr ""
1049
1050 #. type: SS
1051 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1052 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1053 #, no-wrap
1054 msgid "Multithreaded applications"
1055 msgstr ""
1056
1057 #. type: Plain text
1058 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1059 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1060 msgid ""
1061 "If a file descriptor being monitored by B<select>() is closed in another "
1062 "thread, the result is unspecified. On some UNIX systems, B<select>() "
1063 "unblocks and returns, with an indication that the file descriptor is ready "
1064 "(a subsequent I/O operation will likely fail with an error, unless another "
1065 "process reopens the file descriptor between the time B<select>() returned "
1066 "and the I/O operation is performed). On Linux (and some other systems), "
1067 "closing the file descriptor in another thread has no effect on B<select>(). "
1068 "In summary, any application that relies on a particular behavior in this "
1069 "scenario must be considered buggy."
1070 msgstr ""
1071
1072 #. type: SS
1073 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1074 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1075 #, no-wrap
1076 msgid "C library/kernel differences"
1077 msgstr "Diferenças entre kernel/biblioteca C"
1078
1079 #. type: Plain text
1080 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1081 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1082 msgid ""
1083 "The Linux kernel allows file descriptor sets of arbitrary size, determining "
1084 "the length of the sets to be checked from the value of I<nfds>. However, in "
1085 "the glibc implementation, the I<fd_set> type is fixed in size. See also "
1086 "BUGS."
1087 msgstr ""
1088
1089 #. type: Plain text
1090 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1091 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1092 msgid ""
1093 "The B<pselect>() interface described in this page is implemented by glibc. "
1094 "The underlying Linux system call is named B<pselect6>(). This system call "
1095 "has somewhat different behavior from the glibc wrapper function."
1096 msgstr ""
1097
1098 #. type: Plain text
1099 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1101 msgid ""
1102 "The Linux B<pselect6>() system call modifies its I<timeout> argument. "
1103 "However, the glibc wrapper function hides this behavior by using a local "
1104 "variable for the timeout argument that is passed to the system call. Thus, "
1105 "the glibc B<pselect>() function does not modify its I<timeout> argument; "
1106 "this is the behavior required by POSIX.1-2001."
1107 msgstr ""
1108
1109 #. type: Plain text
1110 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1111 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1112 msgid ""
1113 "The final argument of the B<pselect6>() system call is not a I<sigset_t\\ "
1114 "*> pointer, but is instead a structure of the form:"
1115 msgstr ""
1116
1117 #. type: Plain text
1118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1120 #, no-wrap
1121 msgid ""
1122 "struct {\n"
1123 " const kernel_sigset_t *ss; /* Pointer to signal set */\n"
1124 " size_t ss_len; /* Size (in bytes) of object\n"
1125 " pointed to by \\[aq]ss\\[aq] */\n"
1126 "};\n"
1127 msgstr ""
1128
1129 #. type: Plain text
1130 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1131 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1132 msgid ""
1133 "This allows the system call to obtain both a pointer to the signal set and "
1134 "its size, while allowing for the fact that most architectures support a "
1135 "maximum of 6 arguments to a system call. See B<sigprocmask>(2) for a "
1136 "discussion of the difference between the kernel and libc notion of the "
1137 "signal set."
1138 msgstr ""
1139
1140 #. type: SS
1141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1143 #, no-wrap
1144 msgid "Historical glibc details"
1145 msgstr ""
1146
1147 #. type: Plain text
1148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1150 msgid ""
1151 "glibc 2.0 provided an incorrect version of B<pselect>() that did not take a "
1152 "I<sigmask> argument."
1153 msgstr ""
1154
1155 #. type: Plain text
1156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1158 msgid ""
1159 "From glibc 2.1 to glibc 2.2.1, one must define B<_GNU_SOURCE> in order to "
1160 "obtain the declaration of B<pselect>() from I<E<lt>sys/select.hE<gt>>."
1161 msgstr ""
1162
1163 #. type: SH
1164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1166 #, no-wrap
1167 msgid "BUGS"
1168 msgstr "BUGS"
1169
1170 #. type: Plain text
1171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1173 msgid ""
1174 "POSIX allows an implementation to define an upper limit, advertised via the "
1175 "constant B<FD_SETSIZE>, on the range of file descriptors that can be "
1176 "specified in a file descriptor set. The Linux kernel imposes no fixed "
1177 "limit, but the glibc implementation makes I<fd_set> a fixed-size type, with "
1178 "B<FD_SETSIZE> defined as 1024, and the B<FD_*>() macros operating according "
1179 "to that limit. To monitor file descriptors greater than 1023, use "
1180 "B<poll>(2) or B<epoll>(7) instead."
1181 msgstr ""
1182
1183 #. type: Plain text
1184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1186 msgid ""
1187 "The implementation of the I<fd_set> arguments as value-result arguments is a "
1188 "design error that is avoided in B<poll>(2) and B<epoll>(7)."
1189 msgstr ""
1190
1191 #. type: Plain text
1192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1194 msgid ""
1195 "According to POSIX, B<select>() should check all specified file descriptors "
1196 "in the three file descriptor sets, up to the limit I<nfds-1>. However, the "
1197 "current implementation ignores any file descriptor in these sets that is "
1198 "greater than the maximum file descriptor number that the process currently "
1199 "has open. According to POSIX, any such file descriptor that is specified in "
1200 "one of the sets should result in the error B<EBADF>."
1201 msgstr ""
1202
1203 #. type: Plain text
1204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1206 msgid ""
1207 "Starting with glibc 2.1, glibc provided an emulation of B<pselect>() that "
1208 "was implemented using B<sigprocmask>(2) and B<select>(). This "
1209 "implementation remained vulnerable to the very race condition that "
1210 "B<pselect>() was designed to prevent. Modern versions of glibc use the "
1211 "(race-free) B<pselect>() system call on kernels where it is provided."
1212 msgstr ""
1213
1214 #. Stevens discusses a case where accept can block after select
1215 #. returns successfully because of an intervening RST from the client.
1216 #. Maybe the kernel should have returned EIO in such a situation?
1217 #. type: Plain text
1218 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1219 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1220 msgid ""
1221 "On Linux, B<select>() may report a socket file descriptor as \"ready for "
1222 "reading\", while nevertheless a subsequent read blocks. This could for "
1223 "example happen when data has arrived but upon examination has the wrong "
1224 "checksum and is discarded. There may be other circumstances in which a file "
1225 "descriptor is spuriously reported as ready. Thus it may be safer to use "
1226 "B<O_NONBLOCK> on sockets that should not block."
1227 msgstr ""
1228
1229 #. type: Plain text
1230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1232 msgid ""
1233 "On Linux, B<select>() also modifies I<timeout> if the call is interrupted "
1234 "by a signal handler (i.e., the B<EINTR> error return). This is not "
1235 "permitted by POSIX.1. The Linux B<pselect>() system call has the same "
1236 "behavior, but the glibc wrapper hides this behavior by internally copying "
1237 "the I<timeout> to a local variable and passing that variable to the system "
1238 "call."
1239 msgstr ""
1240
1241 #. type: SH
1242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1244 #, no-wrap
1245 msgid "EXAMPLES"
1246 msgstr "EXEMPLOS"
1247
1248 #. type: Plain text
1249 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1250 #: opensuse-tumbleweed
1251 #, no-wrap
1252 msgid ""
1253 "#include E<lt>stdio.hE<gt>\n"
1254 "#include E<lt>stdlib.hE<gt>\n"
1255 "#include E<lt>sys/select.hE<gt>\n"
1256 "#include E<lt>sys/time.hE<gt>\n"
1257 "\\&\n"
1258 "int\n"
1259 "main(void)\n"
1260 "{\n"
1261 " int retval;\n"
1262 " fd_set rfds;\n"
1263 " struct timeval tv;\n"
1264 "\\&\n"
1265 " /* Watch stdin (fd 0) to see when it has input. */\n"
1266 "\\&\n"
1267 " FD_ZERO(&rfds);\n"
1268 " FD_SET(0, &rfds);\n"
1269 "\\&\n"
1270 " /* Wait up to five seconds. */\n"
1271 "\\&\n"
1272 " tv.tv_sec = 5;\n"
1273 " tv.tv_usec = 0;\n"
1274 "\\&\n"
1275 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1276 " /* Don\\[aq]t rely on the value of tv now! */\n"
1277 "\\&\n"
1278 " if (retval == -1)\n"
1279 " perror(\"select()\");\n"
1280 " else if (retval)\n"
1281 " printf(\"Data is available now.\\[rs]n\");\n"
1282 " /* FD_ISSET(0, &rfds) will be true. */\n"
1283 " else\n"
1284 " printf(\"No data within five seconds.\\[rs]n\");\n"
1285 "\\&\n"
1286 " exit(EXIT_SUCCESS);\n"
1287 "}\n"
1288 msgstr ""
1289
1290 #. SRC END
1291 #. type: SH
1292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1294 #, no-wrap
1295 msgid "SEE ALSO"
1296 msgstr "VEJA TAMBÉM"
1297
1298 #. type: Plain text
1299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1301 #, fuzzy
1302 #| msgid ""
1303 #| "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
1304 #| "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
1305 #| "B<epoll>(7), B<time>(7)"
1306 msgid ""
1307 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
1308 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
1309 "B<timespec>(3), B<epoll>(7), B<time>(7)"
1310 msgstr ""
1311 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
1312 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
1313 "B<epoll>(7), B<time>(7)"
1314
1315 #. type: Plain text
1316 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1317 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1318 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
1319 msgstr ""
1320
1321 #. type: TH
1322 #: debian-trixie
1323 #, no-wrap
1324 msgid "2024-06-15"
1325 msgstr "15 junho 2024"
1326
1327 #. type: TH
1328 #: debian-trixie
1329 #, no-wrap
1330 msgid "Linux man-pages 6.9.1"
1331 msgstr "Linux man-pages 6.9.1"
1332
1333 #. type: Plain text
1334 #: debian-trixie
1335 msgid "Standard C library (I<libc>, I<-lc>)"
1336 msgstr "Biblioteca C Padrão (I<libc>, I<-lc>)"
1337
1338 #. type: Plain text
1339 #: debian-trixie fedora-44 fedora-rawhide
1340 #, no-wrap
1341 msgid "B<typedef> /* ... */ B<fd_set;>\n"
1342 msgstr ""
1343
1344 #. type: Plain text
1345 #: debian-trixie fedora-44 fedora-rawhide
1346 #, no-wrap
1347 msgid ""
1348 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1349 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1350 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1351 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
1352 msgstr ""
1353 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1354 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1355 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1356 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
1357
1358 #. .P - it is rumored that:
1359 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
1360 #. - it is certainly true that:
1361 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
1362 #. type: Plain text
1363 #: debian-trixie fedora-44 fedora-rawhide
1364 #, fuzzy
1365 #| msgid ""
1366 #| "On Linux, I<timeout> is modified to reflect the amount of time not slept; "
1367 #| "most other implementations do not do this. This causes problems both "
1368 #| "when Linux code which reads I<timeout> is ported to other operating "
1369 #| "systems, and when code is ported to Linux that reuses a struct timeval "
1370 #| "for multiple B<select>s in a loop without reinitializing it. Consider "
1371 #| "I<timeout> to be undefined after B<select> returns."
1372 msgid ""
1373 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
1374 "slept; most other implementations do not do this. (POSIX.1 permits either "
1375 "behavior.) This causes problems both when Linux code which reads I<timeout> "
1376 "is ported to other operating systems, and when code is ported to Linux that "
1377 "reuses a I<struct timeval> for multiple B<select>()s in a loop without "
1378 "reinitializing it. Consider I<timeout> to be undefined after B<select>() "
1379 "returns."
1380 msgstr ""
1381 "No Linux, I<timeout> é modificado para refletir a quantidade de tempo não "
1382 "inativo; a maior parte das outras implementações não faz isto. Isto causa "
1383 "problemas quando um código Linux que interpreta I<timeout> é portado para "
1384 "outro sistema operacional, e quando código portado para Linux reutiliza uma "
1385 "struct timeval para múltiplos B<select>s em loop sem reinicializá-lo. "
1386 "Considere I<timeout> indefinido após o retorno de B<select>."
1387
1388 #. type: Plain text
1389 #: debian-trixie fedora-44 fedora-rawhide
1390 msgid "POSIX.1-2008."
1391 msgstr "POSIX.1-2008."
1392
1393 #. type: Plain text
1394 #: debian-trixie
1395 #, no-wrap
1396 msgid ""
1397 "#include E<lt>stdio.hE<gt>\n"
1398 "#include E<lt>stdlib.hE<gt>\n"
1399 "#include E<lt>sys/select.hE<gt>\n"
1400 "\\&\n"
1401 "int\n"
1402 "main(void)\n"
1403 "{\n"
1404 " int retval;\n"
1405 " fd_set rfds;\n"
1406 " struct timeval tv;\n"
1407 "\\&\n"
1408 " /* Watch stdin (fd 0) to see when it has input. */\n"
1409 "\\&\n"
1410 " FD_ZERO(&rfds);\n"
1411 " FD_SET(0, &rfds);\n"
1412 "\\&\n"
1413 " /* Wait up to five seconds. */\n"
1414 "\\&\n"
1415 " tv.tv_sec = 5;\n"
1416 " tv.tv_usec = 0;\n"
1417 "\\&\n"
1418 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1419 " /* Don\\[aq]t rely on the value of tv now! */\n"
1420 "\\&\n"
1421 " if (retval == -1)\n"
1422 " perror(\"select()\");\n"
1423 " else if (retval)\n"
1424 " printf(\"Data is available now.\\[rs]n\");\n"
1425 " /* FD_ISSET(0, &rfds) will be true. */\n"
1426 " else\n"
1427 " printf(\"No data within five seconds.\\[rs]n\");\n"
1428 "\\&\n"
1429 " exit(EXIT_SUCCESS);\n"
1430 "}\n"
1431 msgstr ""
1432
1433 #. type: TH
1434 #: fedora-44 fedora-rawhide
1435 #, no-wrap
1436 msgid "2024-11-03"
1437 msgstr "3 novembro 2024"
1438
1439 #. type: TH
1440 #: fedora-44 fedora-rawhide
1441 #, no-wrap
1442 msgid "Linux man-pages 6.13"
1443 msgstr "Linux man-pages 6.13"
1444
1445 #. type: Plain text
1446 #: fedora-44 fedora-rawhide
1447 #, no-wrap
1448 msgid ""
1449 "#include E<lt>stdio.hE<gt>\n"
1450 "#include E<lt>stdlib.hE<gt>\n"
1451 "#include E<lt>sys/select.hE<gt>\n"
1452 "#include E<lt>sys/time.hE<gt>\n"
1453 "\\&\n"
1454 "int\n"
1455 "main(void)\n"
1456 "{\n"
1457 " int retval;\n"
1458 " fd_set rfds;\n"
1459 " struct timeval tv;\n"
1460 "\\&\n"
1461 " /* Watch stdin (fd 0) to see when it has input. */\n"
1462 "\\&\n"
1463 " FD_ZERO(&rfds);\n"
1464 " FD_SET(0, &rfds);\n"
1465 "\\&\n"
1466 " /* Wait up to five seconds. */\n"
1467 "\\&\n"
1468 " tv.tv_sec = 5;\n"
1469 " tv.tv_usec = 0;\n"
1470 "\\&\n"
1471 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1472 " /* Don\\[aq]t rely on the value of tv now! */\n"
1473 "\\&\n"
1474 " if (retval == -1)\n"
1475 " perror(\"select()\");\n"
1476 " else if (retval)\n"
1477 " printf(\"Data is available now.\\[rs]n\");\n"
1478 " /* FD_ISSET(0, &rfds) will be true. */\n"
1479 " else\n"
1480 " printf(\"No data within five seconds.\\[rs]n\");\n"
1481 "\\&\n"
1482 " exit(EXIT_SUCCESS);\n"
1483 "}\n"
1484 msgstr ""
1485
1486 #. type: TH
1487 #: mageia-cauldron
1488 #, no-wrap
1489 msgid "Linux man-pages 6.17"
1490 msgstr "Linux man-pages 6.17"
1491
1492 #. type: TH
1493 #: opensuse-leap-16-1 opensuse-tumbleweed
1494 #, no-wrap
1495 msgid "Linux man-pages (unreleased)"
1496 msgstr "Linux man-pages (não lançado)"