Debian Codegraph @

po/es/man2/poll.2.po

raw
1 # Spanish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Juan Piernas <[email protected]>, 1998.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n\n"
8 "POT-Creation-Date: 2026-06-05 06:35+0200\n"
9 "PO-Revision-Date: 2021-01-30 16:15+0100\n"
10 "Last-Translator: Juan Piernas <[email protected]>\n"
11 "Language-Team: Spanish <[email protected]>\n"
12 "Language: es\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17 "X-Generator: Lokalize 20.04.1\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, fuzzy, no-wrap
23 #| msgid "ppoll()"
24 msgid "poll"
25 msgstr "ppoll()"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 Febrero 2026"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, fuzzy, no-wrap
37 #| msgid "Linux man-pages 6.17"
38 msgid "Linux man-pages 6.18"
39 msgstr "Páginas de Manual de Linux 6.17"
40
41 #. type: SH
42 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
43 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
44 #, no-wrap
45 msgid "NAME"
46 msgstr "NOMBRE"
47
48 #. type: Plain text
49 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
50 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
51 msgid "poll, ppoll - wait for some event on a file descriptor"
52 msgstr "poll, ppoll - espera un evento en un descriptor de fichero"
53
54 #. type: SH
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 #, no-wrap
58 msgid "LIBRARY"
59 msgstr "BIBLIOTECA"
60
61 #. type: Plain text
62 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
63 #: opensuse-leap-16-1 opensuse-tumbleweed
64 msgid "Standard C library (I<libc>,\\ I<-lc>)"
65 msgstr "Biblioteca Estándar C (I<libc>,\\ I<-lc>)"
66
67 #. type: SH
68 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
69 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
70 #, no-wrap
71 msgid "SYNOPSIS"
72 msgstr "SINOPSIS"
73
74 #. type: Plain text
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 #, no-wrap
78 msgid "B<#include E<lt>poll.hE<gt>>\n"
79 msgstr "B<#include E<lt>poll.hE<gt>>\n"
80
81 #. type: Plain text
82 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
83 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
84 #, no-wrap
85 msgid "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int >I<timeout>B<);>\n"
86 msgstr "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int >I<timeout>B<);>\n"
87
88 #. type: Plain text
89 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
90 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
91 #, fuzzy, no-wrap
92 #| msgid ""
93 #| "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
94 #| "B<#include E<lt>fcntl.hE<gt>>\n"
95 msgid ""
96 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
97 "B<#include E<lt>poll.hE<gt>>\n"
98 msgstr ""
99 "B<#define _GNU_SOURCE> /* Vea feature_test_macros(7) */\n"
100 "B<#include E<lt>fcntl.hE<gt>>\n"
101
102 #. type: Plain text
103 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
104 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
105 #, fuzzy, no-wrap
106 #| msgid ""
107 #| "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<,>\n"
108 #| "B< const struct timespec *>I<tmo_p>B<, const sigset_t *>I<sigmask>B<);>\n"
109 msgid ""
110 "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<,>\n"
111 "B< const struct timespec *_Nullable >I<tmo_p>B<,>\n"
112 "B< const sigset_t *_Nullable >I<sigmask>B<);>\n"
113 msgstr ""
114 "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<,>\n"
115 "B< const struct timespec *>I<tmo_p>B<, const sigset_t *>I<sigmask>B<);>\n"
116
117 #. type: SH
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 #, no-wrap
121 msgid "DESCRIPTION"
122 msgstr "DESCRIPCIÓN"
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 msgid ""
128 "B<poll>() performs a similar task to B<select>(2): it waits for one of a "
129 "set of file descriptors to become ready to perform I/O. The Linux-specific "
130 "B<epoll>(7) API performs a similar task, but offers features beyond those "
131 "found in B<poll>()."
132 msgstr ""
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 "The set of file descriptors to be monitored is specified in the I<fds> "
139 "argument, which is an array of structures of the following form:"
140 msgstr ""
141
142 #. type: Plain text
143 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
144 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
145 #, no-wrap
146 msgid ""
147 "struct pollfd {\n"
148 " int fd; /* file descriptor */\n"
149 " short events; /* requested events */\n"
150 " short revents; /* returned events */\n"
151 "};\n"
152 msgstr ""
153 "struct pollfd {\n"
154 " int fd; /* Descriptor de fichero */\n"
155 " short events; /* Eventos solicitados */\n"
156 " short revents; /* Eventos ocurridos */\n"
157 "};\n"
158
159 #. type: Plain text
160 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
161 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
162 msgid ""
163 "The caller should specify the number of items in the I<fds> array in I<nfds>."
164 msgstr ""
165
166 #. type: Plain text
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 msgid ""
170 "The field I<fd> contains a file descriptor for an open file. If this field "
171 "is negative, then the corresponding I<events> field is ignored and the "
172 "I<revents> field returns zero. (This provides an easy way of ignoring a "
173 "file descriptor for a single B<poll>() call: simply set the I<fd> field to "
174 "its bitwise complement.)"
175 msgstr ""
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "The field I<events> is an input parameter, a bit mask specifying the events "
182 "the application is interested in for the file descriptor I<fd>. This field "
183 "may be specified as zero, in which case the only events that can be returned "
184 "in I<revents> are B<POLLHUP>, B<POLLERR>, and B<POLLNVAL> (see below)."
185 msgstr ""
186
187 #. type: Plain text
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 msgid ""
191 "The field I<revents> is an output parameter, filled by the kernel with the "
192 "events that actually occurred. The bits returned in I<revents> can include "
193 "any of those specified in I<events>, or one of the values B<POLLERR>, "
194 "B<POLLHUP>, or B<POLLNVAL>. (These three bits are meaningless in the "
195 "I<events> field, and will be set in the I<revents> field whenever the "
196 "corresponding condition is true.)"
197 msgstr ""
198
199 #. type: Plain text
200 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
201 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
202 msgid ""
203 "If none of the events requested (and no error) has occurred for any of the "
204 "file descriptors, then B<poll>() blocks until one of the events occurs."
205 msgstr ""
206
207 #. type: Plain text
208 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
209 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
210 msgid ""
211 "The I<timeout> argument specifies the number of milliseconds that B<poll>() "
212 "should block waiting for a file descriptor to become ready. The call will "
213 "block until either:"
214 msgstr ""
215
216 #. type: IP
217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
219 #, no-wrap
220 msgid "\\[bu]"
221 msgstr "\\[bu]"
222
223 #. type: Plain text
224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
226 msgid "a file descriptor becomes ready;"
227 msgstr ""
228
229 #. type: Plain text
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 msgid "the call is interrupted by a signal handler; or"
233 msgstr ""
234
235 #. type: Plain text
236 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
237 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
238 msgid "the timeout expires."
239 msgstr ""
240
241 #. type: Plain text
242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
244 msgid ""
245 "Being \"ready\" means that the requested operation will not block; thus, "
246 "B<poll>()ing regular files, block devices, and other files with no "
247 "reasonable polling semantic I<always> returns instantly as ready to read and "
248 "write."
249 msgstr ""
250
251 #. type: Plain text
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 msgid ""
255 "Note that the I<timeout> interval will be rounded up to the system clock "
256 "granularity, and kernel scheduling delays mean that the blocking interval "
257 "may overrun by a small amount. Specifying a negative value in I<timeout> "
258 "means an infinite timeout. Specifying a I<timeout> of zero causes "
259 "B<poll>() to return immediately, even if no file descriptors are ready."
260 msgstr ""
261
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 msgid ""
266 "The bits that may be set/returned in I<events> and I<revents> are defined in "
267 "I<E<lt>poll.hE<gt>>:"
268 msgstr ""
269
270 #. type: TP
271 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
272 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
273 #, no-wrap
274 msgid "B<POLLIN>"
275 msgstr "B<POLLIN>"
276
277 #. type: Plain text
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 msgid "There is data to read."
281 msgstr ""
282
283 #. type: TP
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 #, no-wrap
287 msgid "B<POLLPRI>"
288 msgstr "B<POLLPRI>"
289
290 #. type: Plain text
291 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
292 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
293 msgid ""
294 "There is some exceptional condition on the file descriptor. Possibilities "
295 "include:"
296 msgstr ""
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 msgid "There is out-of-band data on a TCP socket (see B<tcp>(7))."
302 msgstr ""
303
304 #. type: Plain text
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 msgid ""
308 "A pseudoterminal master in packet mode has seen a state change on the slave "
309 "(see B<ioctl_tty>(2))."
310 msgstr ""
311
312 #. type: Plain text
313 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
314 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
315 msgid "A I<cgroup.events> file has been modified (see B<cgroups>(7))."
316 msgstr ""
317
318 #. type: TP
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, no-wrap
322 msgid "B<POLLOUT>"
323 msgstr "B<POLLOUT>"
324
325 #. type: Plain text
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 msgid ""
329 "Writing is now possible, though a write larger than the available space in a "
330 "socket or pipe will still block (unless B<O_NONBLOCK> is set)."
331 msgstr ""
332
333 #. type: TP
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 #, no-wrap
337 msgid "B<POLLRDHUP> (since Linux 2.6.17)"
338 msgstr "B<POLLRDHUP> (desde Linux 2.6.17)"
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 msgid ""
344 "Stream socket peer closed connection, or shut down writing half of "
345 "connection. The B<_GNU_SOURCE> feature test macro must be defined (before "
346 "including I<any> header files) in order to obtain this definition."
347 msgstr ""
348
349 #. type: TP
350 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
351 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
352 #, no-wrap
353 msgid "B<POLLERR>"
354 msgstr "B<POLLERR>"
355
356 #. type: Plain text
357 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
358 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
359 msgid ""
360 "Error condition (only returned in I<revents>; ignored in I<events>). This "
361 "bit is also set for a file descriptor referring to the write end of a pipe "
362 "when the read end has been closed."
363 msgstr ""
364
365 #. type: TP
366 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
367 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
368 #, no-wrap
369 msgid "B<POLLHUP>"
370 msgstr "B<POLLHUP>"
371
372 #. type: Plain text
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 msgid ""
376 "Hang up (only returned in I<revents>; ignored in I<events>). Note that when "
377 "reading from a channel such as a pipe or a stream socket, this event merely "
378 "indicates that the peer closed its end of the channel. Subsequent reads "
379 "from the channel will return 0 (end of file) only after all outstanding "
380 "data in the channel has been consumed."
381 msgstr ""
382
383 #. type: TP
384 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
385 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
386 #, no-wrap
387 msgid "B<POLLNVAL>"
388 msgstr "B<POLLNVAL>"
389
390 #. type: Plain text
391 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
392 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
393 msgid ""
394 "Invalid request: I<fd> not open (only returned in I<revents>; ignored in "
395 "I<events>)."
396 msgstr ""
397
398 #. type: Plain text
399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
401 msgid ""
402 "When compiling with B<_XOPEN_SOURCE> defined, one also has the following, "
403 "which convey no further information beyond the bits listed above:"
404 msgstr ""
405
406 #. type: TP
407 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
408 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
409 #, no-wrap
410 msgid "B<POLLRDNORM>"
411 msgstr "B<POLLRDNORM>"
412
413 #. type: Plain text
414 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
415 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
416 msgid "Equivalent to B<POLLIN>."
417 msgstr ""
418
419 #. type: TP
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "B<POLLRDBAND>"
424 msgstr "B<POLLRDBAND>"
425
426 #. POLLRDBAND is used in the DECnet protocol.
427 #. type: Plain text
428 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
429 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
430 msgid "Priority band data can be read (generally unused on Linux)."
431 msgstr ""
432
433 #. type: TP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "B<POLLWRNORM>"
438 msgstr "B<POLLWRNORM>"
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid "Equivalent to B<POLLOUT>."
444 msgstr ""
445
446 #. type: TP
447 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
448 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
449 #, no-wrap
450 msgid "B<POLLWRBAND>"
451 msgstr "B<POLLWRBAND>"
452
453 #. type: Plain text
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 msgid "Priority data may be written."
457 msgstr ""
458
459 #. type: Plain text
460 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
461 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
462 msgid "Linux also knows about, but does not use B<POLLMSG>."
463 msgstr ""
464
465 #. type: SS
466 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
467 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
468 #, no-wrap
469 msgid "ppoll()"
470 msgstr "ppoll()"
471
472 #. type: Plain text
473 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
474 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
475 msgid ""
476 "The relationship between B<poll>() and B<ppoll>() is analogous to the "
477 "relationship between B<select>(2) and B<pselect>(2): like B<pselect>(2), "
478 "B<ppoll>() allows an application to safely wait until either a file "
479 "descriptor becomes ready or until a signal is caught."
480 msgstr ""
481
482 #. type: Plain text
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 msgid ""
486 "Other than the difference in the precision of the I<timeout> argument, the "
487 "following B<ppoll>() call:"
488 msgstr ""
489
490 #. type: Plain text
491 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
492 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
493 #, no-wrap
494 msgid "ready = ppoll(&fds, nfds, tmo_p, &sigmask);\n"
495 msgstr "ready = ppoll(&fds, nfds, tmo_p, &sigmask);\n"
496
497 #. type: Plain text
498 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
499 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
500 msgid "is nearly equivalent to I<atomically> executing the following calls:"
501 msgstr ""
502
503 #. type: Plain text
504 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
505 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
506 #, fuzzy, no-wrap
507 #| msgid ""
508 #| "timeout = (tmo_p == NULL) ? -1 :\n"
509 #| " (tmo_p-E<gt>tv_sec * 1000 + tmo_p-E<gt>tv_nsec / 1000000);\n"
510 #| "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
511 #| "ready = poll(&fds, nfds, timeout);\n"
512 #| "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
513 msgid ""
514 "sigset_t origmask;\n"
515 "int timeout;\n"
516 "\\&\n"
517 "timeout = (tmo_p == NULL) ? -1 :\n"
518 " (tmo_p-E<gt>tv_sec * 1000 + tmo_p-E<gt>tv_nsec / 1000000);\n"
519 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
520 "ready = poll(&fds, nfds, timeout);\n"
521 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
522 msgstr ""
523 "timeout = (tmo_p == NULL) ? -1 :\n"
524 " (tmo_p-E<gt>tv_sec * 1000 + tmo_p-E<gt>tv_nsec / 1000000);\n"
525 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
526 "ready = poll(&fds, nfds, timeout);\n"
527 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
528
529 #. type: Plain text
530 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
531 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
532 msgid ""
533 "The above code segment is described as I<nearly> equivalent because whereas "
534 "a negative I<timeout> value for B<poll>() is interpreted as an infinite "
535 "timeout, a negative value expressed in I<*tmo_p> results in an error from "
536 "B<ppoll>()."
537 msgstr ""
538
539 #. type: Plain text
540 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
541 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
542 msgid ""
543 "See the description of B<pselect>(2) for an explanation of why B<ppoll>() "
544 "is necessary."
545 msgstr ""
546
547 #. type: Plain text
548 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
549 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
550 msgid ""
551 "If the I<sigmask> argument is specified as NULL, then no signal mask "
552 "manipulation is performed (and thus B<ppoll>() differs from B<poll>() only "
553 "in the precision of the I<timeout> argument)."
554 msgstr ""
555
556 #. type: Plain text
557 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
558 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
559 msgid ""
560 "The I<tmo_p> argument specifies an upper limit on the amount of time that "
561 "B<ppoll>() will block. This argument is a pointer to a B<timespec>(3) "
562 "structure."
563 msgstr ""
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 "If I<tmo_p> is specified as NULL, then B<ppoll>() can block indefinitely."
570 msgstr ""
571
572 #. type: SH
573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
575 #, no-wrap
576 msgid "RETURN VALUE"
577 msgstr "VALOR DEVUELTO"
578
579 #. type: Plain text
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 msgid ""
583 "On success, B<poll>() returns a nonnegative value which is the number of "
584 "elements in the I<pollfds> whose I<revents> fields have been set to a "
585 "nonzero value (indicating an event or an error). A return value of zero "
586 "indicates that the system call timed out before any file descriptors became "
587 "ready."
588 msgstr ""
589
590 #. type: Plain text
591 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
592 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
593 #, fuzzy
594 #| msgid ""
595 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
596 #| "set appropriately."
597 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
598 msgstr ""
599 "En caso de éxito se devuelve cero. En caso de error se devuelve -1, y "
600 "I<errno> se configura adecuadamente."
601
602 #. type: SH
603 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
604 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
605 #, no-wrap
606 msgid "ERRORS"
607 msgstr "ERRORES"
608
609 #. type: TP
610 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
611 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
612 #, no-wrap
613 msgid "B<EFAULT>"
614 msgstr "B<EFAULT>"
615
616 #. type: Plain text
617 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
618 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
619 #, fuzzy
620 #| msgid ""
621 #| "The array given as argument was not contained in the calling program's "
622 #| "address space."
623 msgid ""
624 "I<fds> points outside the process's accessible address space. The array "
625 "given as argument was not contained in the calling program's address space."
626 msgstr ""
627 "El vector pasado como argumento no está ubicado en el espacio de direcciones "
628 "del programa invocador."
629
630 #. type: TP
631 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
632 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
633 #, no-wrap
634 msgid "B<EINTR>"
635 msgstr "B<EINTR>"
636
637 #. type: Plain text
638 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
639 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
640 #, fuzzy
641 #| msgid "A signal occurred before any requested event."
642 msgid "A signal occurred before any requested event; see B<signal>(7)."
643 msgstr "Se ha producido una señal antes de cualquier evento."
644
645 #. type: TP
646 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
647 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
648 #, no-wrap
649 msgid "B<EINVAL>"
650 msgstr "B<EINVAL>"
651
652 #. type: Plain text
653 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
654 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
655 msgid "The I<nfds> value exceeds the B<RLIMIT_NOFILE> value."
656 msgstr ""
657
658 #. type: Plain text
659 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
660 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
661 msgid ""
662 "(B<ppoll>()) The timeout value expressed in I<*tmo_p> is invalid (negative)."
663 msgstr ""
664
665 #. type: TP
666 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
667 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
668 #, no-wrap
669 msgid "B<ENOMEM>"
670 msgstr "B<ENOMEM>"
671
672 #. type: Plain text
673 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
674 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
675 msgid "Unable to allocate memory for kernel data structures."
676 msgstr ""
677
678 #. type: SH
679 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
680 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
681 #, no-wrap
682 msgid "VERSIONS"
683 msgstr "VERSIONES"
684
685 #. Darwin, according to a report by Jeremy Sequoia, relayed by Josh Triplett
686 #. type: Plain text
687 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
688 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
689 msgid ""
690 "On some other UNIX systems, B<poll>() can fail with the error B<EAGAIN> if "
691 "the system fails to allocate kernel-internal resources, rather than "
692 "B<ENOMEM> as Linux does. POSIX permits this behavior. Portable programs "
693 "may wish to check for B<EAGAIN> and loop, just as with B<EINTR>."
694 msgstr ""
695
696 #. type: Plain text
697 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
698 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
699 msgid ""
700 "Some implementations define the nonstandard constant B<INFTIM> with the "
701 "value -1 for use as a I<timeout> for B<poll>(). This constant is not "
702 "provided in glibc."
703 msgstr ""
704
705 #. type: SS
706 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
707 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
708 #, no-wrap
709 msgid "C library/kernel differences"
710 msgstr "Diferencias núcleo / biblioteca C"
711
712 #. type: Plain text
713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
715 msgid ""
716 "The Linux B<ppoll>() system call modifies its I<tmo_p> argument. However, "
717 "the glibc wrapper function hides this behavior by using a local variable for "
718 "the timeout argument that is passed to the system call. Thus, the glibc "
719 "B<ppoll>() function does not modify its I<tmo_p> argument."
720 msgstr ""
721
722 #. type: Plain text
723 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
724 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
725 msgid ""
726 "The raw B<ppoll>() system call has a fifth argument, I<size_t sigsetsize>, "
727 "which specifies the size in bytes of the I<sigmask> argument. The glibc "
728 "B<ppoll>() wrapper function specifies this argument as a fixed value (equal "
729 "to I<sizeof(kernel_sigset_t)>). See B<sigprocmask>(2) for a discussion on "
730 "the differences between the kernel and the libc notion of the sigset."
731 msgstr ""
732
733 #. type: SH
734 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
735 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
736 #, no-wrap
737 msgid "STANDARDS"
738 msgstr "ESTÁNDARES"
739
740 #. type: Plain text
741 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
742 #: opensuse-tumbleweed
743 msgid "POSIX.1-2024."
744 msgstr "POSIX.1-2024."
745
746 #. type: SH
747 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
748 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
749 #, no-wrap
750 msgid "HISTORY"
751 msgstr "HISTORIAL"
752
753 #. type: TP
754 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
755 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
756 #, fuzzy, no-wrap
757 #| msgid "B<poll>(2)"
758 msgid "B<poll>()"
759 msgstr "B<poll>(2)"
760
761 #. type: Plain text
762 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
763 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
764 #, fuzzy
765 #| msgid "POSIX.1-2001."
766 msgid "POSIX.1-2001. Linux 2.1.23."
767 msgstr "POSIX.1-2001."
768
769 #. type: Plain text
770 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
771 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
772 #, fuzzy
773 #| msgid ""
774 #| "The poll() systemcall was introduced in Linux 2.1.23. The poll() library "
775 #| "call was introduced in libc 5.4.28 (and provides emulation using select "
776 #| "if your kernel does not have a poll syscall)."
777 msgid ""
778 "On older kernels that lack this system call, the glibc B<poll>() wrapper "
779 "function provides emulation using B<select>(2)."
780 msgstr ""
781 "La llamada al sistema B<poll()> se introdujo en la versión 2.1.23 de Linux. "
782 "La función de biblioteca B<poll()> se introdujo en la versión 5.4.28 de libc "
783 "(y emula la llamada al sistema B<poll> mediante B<select> si su núcleo no "
784 "tiene dicha llamada al sistema)."
785
786 #. type: TP
787 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
788 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
789 #, fuzzy, no-wrap
790 #| msgid "B<poll>(2)"
791 msgid "B<ppoll>()"
792 msgstr "B<poll>(2)"
793
794 #. type: Plain text
795 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
796 #: opensuse-tumbleweed
797 #, fuzzy
798 #| msgid "POSIX.1-2001."
799 msgid "POSIX.1-2024. Linux 2.6.16, glibc 2.4."
800 msgstr "POSIX.1-2001."
801
802 #. type: SH
803 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
804 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
805 #, no-wrap
806 msgid "NOTES"
807 msgstr "NOTAS"
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 ""
813 "The operation of B<poll>() and B<ppoll>() is not affected by the "
814 "B<O_NONBLOCK> flag."
815 msgstr ""
816
817 #. type: Plain text
818 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
819 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
820 msgid ""
821 "For a discussion of what may happen if a file descriptor being monitored by "
822 "B<poll>() is closed in another thread, see B<select>(2)."
823 msgstr ""
824
825 #. type: SH
826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
828 #, no-wrap
829 msgid "BUGS"
830 msgstr "ERRORES"
831
832 #. type: Plain text
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 msgid ""
836 "See the discussion of spurious readiness notifications under the BUGS "
837 "section of B<select>(2)."
838 msgstr ""
839
840 #. type: SH
841 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
842 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
843 #, no-wrap
844 msgid "EXAMPLES"
845 msgstr "EJEMPLOS"
846
847 #. type: Plain text
848 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
849 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
850 msgid ""
851 "The program below opens each of the files named in its command-line "
852 "arguments and monitors the resulting file descriptors for readiness to read "
853 "(B<POLLIN>). The program loops, repeatedly using B<poll>() to monitor the "
854 "file descriptors, printing the number of ready file descriptors on return. "
855 "For each ready file descriptor, the program:"
856 msgstr ""
857
858 #. type: Plain text
859 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
860 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
861 msgid "displays the returned I<revents> field in a human-readable form;"
862 msgstr ""
863
864 #. type: Plain text
865 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
866 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
867 msgid ""
868 "if the file descriptor is readable, reads some data from it, and displays "
869 "that data on standard output; and"
870 msgstr ""
871
872 #. type: Plain text
873 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
874 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
875 msgid ""
876 "if the file descriptor was not readable, but some other event occurred "
877 "(presumably B<POLLHUP>), closes the file descriptor."
878 msgstr ""
879
880 #. type: Plain text
881 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
882 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
883 msgid "Suppose we run the program in one terminal, asking it to open a FIFO:"
884 msgstr ""
885
886 #. type: Plain text
887 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
888 #: opensuse-tumbleweed
889 #, fuzzy, no-wrap
890 #| msgid ""
891 #| "$ B<mkfifo myfifo>\n"
892 #| "$ B<./poll_input myfifo>\n"
893 msgid ""
894 "$B< mkfifo myfifo>;\n"
895 "$B< ./poll_input myfifo>;\n"
896 msgstr ""
897 "$ B<mkfifo myfifo>\n"
898 "$ B<./poll_input myfifo>\n"
899
900 #. type: Plain text
901 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
902 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
903 msgid ""
904 "In a second terminal window, we then open the FIFO for writing, write some "
905 "data to it, and close the FIFO:"
906 msgstr ""
907
908 #. type: Plain text
909 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
910 #: opensuse-tumbleweed
911 #, fuzzy, no-wrap
912 #| msgid "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
913 msgid "$B< echo aaaaabbbbbccccc E<gt> myfifo>;\n"
914 msgstr "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
915
916 #. type: Plain text
917 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
918 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
919 msgid "In the terminal where we are running the program, we would then see:"
920 msgstr ""
921
922 #. type: Plain text
923 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
924 #: opensuse-tumbleweed
925 #, no-wrap
926 msgid ""
927 "Opened \"myfifo\" on fd 3\n"
928 "About to poll()\n"
929 "Ready: 1\n"
930 " fd=3; events: POLLIN POLLHUP\n"
931 " read 10 bytes: aaaaabbbbb\n"
932 "About to poll()\n"
933 "Ready: 1\n"
934 " fd=3; events: POLLIN POLLHUP\n"
935 " read 6 bytes: ccccc\n"
936 "\\&\n"
937 "About to poll()\n"
938 "Ready: 1\n"
939 " fd=3; events: POLLHUP\n"
940 " closing fd 3\n"
941 "All file descriptors closed. Bye.\n"
942 msgstr ""
943
944 #. type: Plain text
945 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
946 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
947 msgid "In the above output, we see that B<poll>() returned three times:"
948 msgstr ""
949
950 #. type: Plain text
951 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
952 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
953 msgid ""
954 "On the first return, the bits returned in the I<revents> field were "
955 "B<POLLIN>, indicating that the file descriptor is readable, and B<POLLHUP>, "
956 "indicating that the other end of the FIFO has been closed. The program then "
957 "consumed some of the available input."
958 msgstr ""
959
960 #. type: Plain text
961 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
962 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
963 msgid ""
964 "The second return from B<poll>() also indicated B<POLLIN> and B<POLLHUP>; "
965 "the program then consumed the last of the available input."
966 msgstr ""
967
968 #. type: Plain text
969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
971 msgid ""
972 "On the final return, B<poll>() indicated only B<POLLHUP> on the FIFO, at "
973 "which point the file descriptor was closed and the program terminated."
974 msgstr ""
975
976 #. type: SS
977 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
978 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
979 #, no-wrap
980 msgid "Program source"
981 msgstr "Código fuente"
982
983 #. type: Plain text
984 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
985 #: opensuse-tumbleweed
986 #, no-wrap
987 msgid ""
988 "/* poll_input.c\n"
989 "\\&\n"
990 " Licensed under GNU General Public License v2 or later.\n"
991 "*/\n"
992 "#include E<lt>err.hE<gt>\n"
993 "#include E<lt>fcntl.hE<gt>\n"
994 "#include E<lt>poll.hE<gt>\n"
995 "#include E<lt>stdio.hE<gt>\n"
996 "#include E<lt>stdlib.hE<gt>\n"
997 "#include E<lt>sys/types.hE<gt>\n"
998 "#include E<lt>unistd.hE<gt>\n"
999 "\\&\n"
1000 "int\n"
1001 "main(int argc, char *argv[])\n"
1002 "{\n"
1003 " int ready;\n"
1004 " char buf[10];\n"
1005 " nfds_t num_open_fds, nfds;\n"
1006 " ssize_t s;\n"
1007 " struct pollfd *pfds;\n"
1008 "\\&\n"
1009 " if (argc E<lt> 2) {\n"
1010 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1011 " exit(EXIT_FAILURE);\n"
1012 " }\n"
1013 "\\&\n"
1014 " num_open_fds = nfds = argc - 1;\n"
1015 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1016 " if (pfds == NULL)\n"
1017 " err(EXIT_FAILURE, \"malloc\");\n"
1018 "\\&\n"
1019 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1020 "\\&\n"
1021 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1022 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1023 " if (pfds[j].fd == -1)\n"
1024 " err(EXIT_FAILURE, \"open\");\n"
1025 "\\&\n"
1026 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1027 "\\&\n"
1028 " pfds[j].events = POLLIN;\n"
1029 " }\n"
1030 "\\&\n"
1031 " /* Keep calling poll() as long as at least one file descriptor is\n"
1032 " open. */\n"
1033 "\\&\n"
1034 " while (num_open_fds E<gt> 0) {\n"
1035 " printf(\"About to poll()\\[rs]n\");\n"
1036 " ready = poll(pfds, nfds, -1);\n"
1037 " if (ready == -1)\n"
1038 " err(EXIT_FAILURE, \"poll\");\n"
1039 "\\&\n"
1040 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1041 "\\&\n"
1042 " /* Deal with array returned by poll(). */\n"
1043 "\\&\n"
1044 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1045 " if (pfds[j].revents != 0) {\n"
1046 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1047 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1048 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1049 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1050 "\\&\n"
1051 " if (pfds[j].revents & POLLIN) {\n"
1052 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1053 " if (s == -1)\n"
1054 " err(EXIT_FAILURE, \"read\");\n"
1055 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1056 " s, (int) s, buf);\n"
1057 " } else { /* POLLERR | POLLHUP */\n"
1058 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1059 " if (close(pfds[j].fd) == -1)\n"
1060 " err(EXIT_FAILURE, \"close\");\n"
1061 " num_open_fds--;\n"
1062 " }\n"
1063 " }\n"
1064 " }\n"
1065 " }\n"
1066 "\\&\n"
1067 " printf(\"All file descriptors closed. Bye.\\[rs]n\");\n"
1068 " exit(EXIT_SUCCESS);\n"
1069 "}\n"
1070 msgstr ""
1071
1072 #. SRC END
1073 #. type: SH
1074 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1075 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1076 #, no-wrap
1077 msgid "SEE ALSO"
1078 msgstr "VÉASE TAMBIÉN"
1079
1080 #. type: Plain text
1081 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1082 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1083 #, fuzzy
1084 #| msgid ""
1085 #| "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<epoll>(7), "
1086 #| "B<time>(7)"
1087 msgid ""
1088 "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<timespec>(3), "
1089 "B<epoll>(7), B<time>(7)"
1090 msgstr ""
1091 "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<epoll>(7), "
1092 "B<time>(7)"
1093
1094 #. type: TH
1095 #: debian-trixie
1096 #, no-wrap
1097 msgid "2024-06-15"
1098 msgstr "15 Junio 2024"
1099
1100 #. type: TH
1101 #: debian-trixie
1102 #, no-wrap
1103 msgid "Linux man-pages 6.9.1"
1104 msgstr "Páginas de Manual de Linux 6.9.1"
1105
1106 #. type: Plain text
1107 #: debian-trixie
1108 msgid "Standard C library (I<libc>, I<-lc>)"
1109 msgstr "Biblioteca Estándar C (I<libc>, I<-lc>)"
1110
1111 #. type: Plain text
1112 #: debian-trixie fedora-44 fedora-rawhide
1113 msgid "POSIX.1-2008."
1114 msgstr "POSIX.1-2008."
1115
1116 #. FIXME .
1117 #. ppoll() is proposed for inclusion in POSIX:
1118 #. https://www.austingroupbugs.net/view.php?id=1263
1119 #. NetBSD 3.0 has a pollts() which is like Linux ppoll().
1120 #. type: Plain text
1121 #: debian-trixie fedora-44 fedora-rawhide
1122 msgid "Linux."
1123 msgstr "Linux."
1124
1125 #. type: Plain text
1126 #: debian-trixie fedora-44 fedora-rawhide
1127 msgid "Linux 2.6.16, glibc 2.4."
1128 msgstr "Linux 2.6.16, glibc 2.4."
1129
1130 #. type: Plain text
1131 #: debian-trixie fedora-44 fedora-rawhide
1132 #, no-wrap
1133 msgid ""
1134 "$ B<mkfifo myfifo>\n"
1135 "$ B<./poll_input myfifo>\n"
1136 msgstr ""
1137 "$ B<mkfifo myfifo>\n"
1138 "$ B<./poll_input myfifo>\n"
1139
1140 #. type: Plain text
1141 #: debian-trixie fedora-44 fedora-rawhide
1142 #, no-wrap
1143 msgid "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
1144 msgstr "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
1145
1146 #. type: Plain text
1147 #: debian-trixie fedora-44 fedora-rawhide
1148 #, no-wrap
1149 msgid ""
1150 "Opened \"myfifo\" on fd 3\n"
1151 "About to poll()\n"
1152 "Ready: 1\n"
1153 " fd=3; events: POLLIN POLLHUP\n"
1154 " read 10 bytes: aaaaabbbbb\n"
1155 "About to poll()\n"
1156 "Ready: 1\n"
1157 " fd=3; events: POLLIN POLLHUP\n"
1158 " read 6 bytes: ccccc\n"
1159 "\\&\n"
1160 "About to poll()\n"
1161 "Ready: 1\n"
1162 " fd=3; events: POLLHUP\n"
1163 " closing fd 3\n"
1164 "All file descriptors closed; bye\n"
1165 msgstr ""
1166
1167 #. type: Plain text
1168 #: debian-trixie fedora-44 fedora-rawhide
1169 #, no-wrap
1170 msgid ""
1171 "/* poll_input.c\n"
1172 "\\&\n"
1173 " Licensed under GNU General Public License v2 or later.\n"
1174 "*/\n"
1175 "#include E<lt>fcntl.hE<gt>\n"
1176 "#include E<lt>poll.hE<gt>\n"
1177 "#include E<lt>stdio.hE<gt>\n"
1178 "#include E<lt>stdlib.hE<gt>\n"
1179 "#include E<lt>sys/types.hE<gt>\n"
1180 "#include E<lt>unistd.hE<gt>\n"
1181 "\\&\n"
1182 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1183 " } while (0)\n"
1184 "\\&\n"
1185 "int\n"
1186 "main(int argc, char *argv[])\n"
1187 "{\n"
1188 " int ready;\n"
1189 " char buf[10];\n"
1190 " nfds_t num_open_fds, nfds;\n"
1191 " ssize_t s;\n"
1192 " struct pollfd *pfds;\n"
1193 "\\&\n"
1194 " if (argc E<lt> 2) {\n"
1195 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1196 " exit(EXIT_FAILURE);\n"
1197 " }\n"
1198 "\\&\n"
1199 " num_open_fds = nfds = argc - 1;\n"
1200 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1201 " if (pfds == NULL)\n"
1202 " errExit(\"malloc\");\n"
1203 "\\&\n"
1204 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1205 "\\&\n"
1206 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1207 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1208 " if (pfds[j].fd == -1)\n"
1209 " errExit(\"open\");\n"
1210 "\\&\n"
1211 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1212 "\\&\n"
1213 " pfds[j].events = POLLIN;\n"
1214 " }\n"
1215 "\\&\n"
1216 " /* Keep calling poll() as long as at least one file descriptor is\n"
1217 " open. */\n"
1218 "\\&\n"
1219 " while (num_open_fds E<gt> 0) {\n"
1220 " printf(\"About to poll()\\[rs]n\");\n"
1221 " ready = poll(pfds, nfds, -1);\n"
1222 " if (ready == -1)\n"
1223 " errExit(\"poll\");\n"
1224 "\\&\n"
1225 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1226 "\\&\n"
1227 " /* Deal with array returned by poll(). */\n"
1228 "\\&\n"
1229 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1230 " if (pfds[j].revents != 0) {\n"
1231 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1232 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1233 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1234 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1235 "\\&\n"
1236 " if (pfds[j].revents & POLLIN) {\n"
1237 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1238 " if (s == -1)\n"
1239 " errExit(\"read\");\n"
1240 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1241 " s, (int) s, buf);\n"
1242 " } else { /* POLLERR | POLLHUP */\n"
1243 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1244 " if (close(pfds[j].fd) == -1)\n"
1245 " errExit(\"close\");\n"
1246 " num_open_fds--;\n"
1247 " }\n"
1248 " }\n"
1249 " }\n"
1250 " }\n"
1251 "\\&\n"
1252 " printf(\"All file descriptors closed; bye\\[rs]n\");\n"
1253 " exit(EXIT_SUCCESS);\n"
1254 "}\n"
1255 msgstr ""
1256
1257 #. type: TH
1258 #: fedora-44 fedora-rawhide
1259 #, no-wrap
1260 msgid "2024-07-23"
1261 msgstr "23 ​​Julio 2024"
1262
1263 #. type: TH
1264 #: fedora-44 fedora-rawhide
1265 #, no-wrap
1266 msgid "Linux man-pages 6.13"
1267 msgstr "Páginas de Manual de Linux 6.13"
1268
1269 #. type: TH
1270 #: mageia-cauldron
1271 #, no-wrap
1272 msgid "Linux man-pages 6.17"
1273 msgstr "Páginas de Manual de Linux 6.17"
1274
1275 #. type: TH
1276 #: opensuse-leap-16-1 opensuse-tumbleweed
1277 #, no-wrap
1278 msgid "Linux man-pages (unreleased)"
1279 msgstr "Páginas de Manual de Linux (no publicadas)"