OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.54
[linuxjm/LDP_man-pages.git] / po4a / epoll / po / epoll.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2013-09-28 04:06+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man7/epoll.7:21
21 #, no-wrap
22 msgid "EPOLL"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man7/epoll.7:21
27 #, no-wrap
28 msgid "2012-04-17"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man7/epoll.7:21 build/C/man2/epoll_create.2:24 build/C/man2/epoll_ctl.2:20 build/C/man2/epoll_wait.2:22 build/C/man2/poll.2:31
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man7/epoll.7:21 build/C/man2/epoll_create.2:24 build/C/man2/epoll_ctl.2:20 build/C/man2/epoll_wait.2:22 build/C/man2/poll.2:31
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man7/epoll.7:22 build/C/man2/epoll_create.2:25 build/C/man2/epoll_ctl.2:21 build/C/man2/epoll_wait.2:23 build/C/man2/poll.2:32
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man7/epoll.7:24
51 msgid "epoll - I/O event notification facility"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man7/epoll.7:24 build/C/man2/epoll_create.2:27 build/C/man2/epoll_ctl.2:23 build/C/man2/epoll_wait.2:25 build/C/man2/poll.2:34
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man7/epoll.7:26 build/C/man2/epoll_ctl.2:25
62 msgid "B<#include E<lt>sys/epoll.hE<gt>>"
63 msgstr ""
64
65 #. type: SH
66 #: build/C/man7/epoll.7:26 build/C/man2/epoll_create.2:34 build/C/man2/epoll_ctl.2:28 build/C/man2/epoll_wait.2:35 build/C/man2/poll.2:46
67 #, no-wrap
68 msgid "DESCRIPTION"
69 msgstr ""
70
71 #. type: Plain text
72 #: build/C/man7/epoll.7:40
73 msgid ""
74 "The B<epoll> API performs a similar task to B<poll>(2): monitoring multiple "
75 "file descriptors to see if I/O is possible on any of them.  The B<epoll> API "
76 "can be used either as an edge-triggered or a level-triggered interface and "
77 "scales well to large numbers of watched file descriptors.  The following "
78 "system calls are provided to create and manage an B<epoll> instance:"
79 msgstr ""
80
81 #. type: IP
82 #: build/C/man7/epoll.7:40 build/C/man7/epoll.7:49 build/C/man7/epoll.7:57
83 #, no-wrap
84 msgid "*"
85 msgstr ""
86
87 #. type: Plain text
88 #: build/C/man7/epoll.7:49
89 msgid ""
90 "B<epoll_create>(2)  creates an B<epoll> instance and returns a file "
91 "descriptor referring to that instance.  (The more recent B<epoll_create1>(2)  "
92 "extends the functionality of B<epoll_create>(2).)"
93 msgstr ""
94
95 #. type: Plain text
96 #: build/C/man7/epoll.7:57
97 msgid ""
98 "Interest in particular file descriptors is then registered via "
99 "B<epoll_ctl>(2).  The set of file descriptors currently registered on an "
100 "B<epoll> instance is sometimes called an I<epoll> set."
101 msgstr ""
102
103 #. type: Plain text
104 #: build/C/man7/epoll.7:61
105 msgid ""
106 "B<epoll_wait>(2)  waits for I/O events, blocking the calling thread if no "
107 "events are currently available."
108 msgstr ""
109
110 #. type: SS
111 #: build/C/man7/epoll.7:61
112 #, no-wrap
113 msgid "Level-triggered and edge-triggered"
114 msgstr ""
115
116 #. type: Plain text
117 #: build/C/man7/epoll.7:70
118 msgid ""
119 "The B<epoll> event distribution interface is able to behave both as "
120 "edge-triggered (ET) and as level-triggered (LT).  The difference between the "
121 "two mechanisms can be described as follows.  Suppose that this scenario "
122 "happens:"
123 msgstr ""
124
125 #. type: IP
126 #: build/C/man7/epoll.7:70
127 #, no-wrap
128 msgid "1."
129 msgstr ""
130
131 #. type: Plain text
132 #: build/C/man7/epoll.7:76
133 msgid ""
134 "The file descriptor that represents the read side of a pipe (I<rfd>)  is "
135 "registered on the B<epoll> instance."
136 msgstr ""
137
138 #. type: IP
139 #: build/C/man7/epoll.7:76
140 #, no-wrap
141 msgid "2."
142 msgstr ""
143
144 #. type: Plain text
145 #: build/C/man7/epoll.7:78
146 msgid "A pipe writer writes 2 kB of data on the write side of the pipe."
147 msgstr ""
148
149 #. type: IP
150 #: build/C/man7/epoll.7:78
151 #, no-wrap
152 msgid "3."
153 msgstr ""
154
155 #. type: Plain text
156 #: build/C/man7/epoll.7:84
157 msgid ""
158 "A call to B<epoll_wait>(2)  is done that will return I<rfd> as a ready file "
159 "descriptor."
160 msgstr ""
161
162 #. type: IP
163 #: build/C/man7/epoll.7:84
164 #, no-wrap
165 msgid "4."
166 msgstr ""
167
168 #. type: Plain text
169 #: build/C/man7/epoll.7:87
170 msgid "The pipe reader reads 1 kB of data from I<rfd>."
171 msgstr ""
172
173 #. type: IP
174 #: build/C/man7/epoll.7:87
175 #, no-wrap
176 msgid "5."
177 msgstr ""
178
179 #. type: Plain text
180 #: build/C/man7/epoll.7:91
181 msgid "A call to B<epoll_wait>(2)  is done."
182 msgstr ""
183
184 #. type: Plain text
185 #: build/C/man7/epoll.7:126
186 msgid ""
187 "If the I<rfd> file descriptor has been added to the B<epoll> interface using "
188 "the B<EPOLLET> (edge-triggered)  flag, the call to B<epoll_wait>(2)  done in "
189 "step B<5> will probably hang despite the available data still present in the "
190 "file input buffer; meanwhile the remote peer might be expecting a response "
191 "based on the data it already sent.  The reason for this is that "
192 "edge-triggered mode delivers events only when changes occur on the monitored "
193 "file descriptor.  So, in step B<5> the caller might end up waiting for some "
194 "data that is already present inside the input buffer.  In the above example, "
195 "an event on I<rfd> will be generated because of the write done in B<2> and "
196 "the event is consumed in B<3>.  Since the read operation done in B<4> does "
197 "not consume the whole buffer data, the call to B<epoll_wait>(2)  done in "
198 "step B<5> might block indefinitely."
199 msgstr ""
200
201 #. type: Plain text
202 #: build/C/man7/epoll.7:136
203 msgid ""
204 "An application that employs the B<EPOLLET> flag should use nonblocking file "
205 "descriptors to avoid having a blocking read or write starve a task that is "
206 "handling multiple file descriptors.  The suggested way to use B<epoll> as an "
207 "edge-triggered (B<EPOLLET>)  interface is as follows:"
208 msgstr ""
209
210 #. type: TP
211 #: build/C/man7/epoll.7:137
212 #, no-wrap
213 msgid "B<i>"
214 msgstr ""
215
216 #. type: Plain text
217 #: build/C/man7/epoll.7:140
218 msgid "with nonblocking file descriptors; and"
219 msgstr ""
220
221 #. type: TP
222 #: build/C/man7/epoll.7:140
223 #, no-wrap
224 msgid "B<ii>"
225 msgstr ""
226
227 #. type: Plain text
228 #: build/C/man7/epoll.7:148
229 msgid ""
230 "by waiting for an event only after B<read>(2)  or B<write>(2)  return "
231 "B<EAGAIN>."
232 msgstr ""
233
234 #. type: Plain text
235 #: build/C/man7/epoll.7:159
236 msgid ""
237 "By contrast, when used as a level-triggered interface (the default, when "
238 "B<EPOLLET> is not specified), B<epoll> is simply a faster B<poll>(2), and "
239 "can be used wherever the latter is used since it shares the same semantics."
240 msgstr ""
241
242 #. type: Plain text
243 #: build/C/man7/epoll.7:176
244 msgid ""
245 "Since even with edge-triggered B<epoll>, multiple events can be generated "
246 "upon receipt of multiple chunks of data, the caller has the option to "
247 "specify the B<EPOLLONESHOT> flag, to tell B<epoll> to disable the associated "
248 "file descriptor after the receipt of an event with B<epoll_wait>(2).  When "
249 "the B<EPOLLONESHOT> flag is specified, it is the caller's responsibility to "
250 "rearm the file descriptor using B<epoll_ctl>(2)  with B<EPOLL_CTL_MOD>."
251 msgstr ""
252
253 #. type: SS
254 #: build/C/man7/epoll.7:176
255 #, no-wrap
256 msgid "/proc interfaces"
257 msgstr ""
258
259 #.  Following was added in 2.6.28, but them removed in 2.6.29
260 #.  .TP
261 #.  .IR /proc/sys/fs/epoll/max_user_instances " (since Linux 2.6.28)"
262 #.  This specifies an upper limit on the number of epoll instances
263 #.  that can be created per real user ID.
264 #. type: Plain text
265 #: build/C/man7/epoll.7:184
266 msgid ""
267 "The following interfaces can be used to limit the amount of kernel memory "
268 "consumed by epoll:"
269 msgstr ""
270
271 #. type: TP
272 #: build/C/man7/epoll.7:184
273 #, no-wrap
274 msgid "I</proc/sys/fs/epoll/max_user_watches> (since Linux 2.6.28)"
275 msgstr ""
276
277 #.  2.6.29 (in 2.6.28, the default was 1/32 of lowmem)
278 #. type: Plain text
279 #: build/C/man7/epoll.7:198
280 msgid ""
281 "This specifies a limit on the total number of file descriptors that a user "
282 "can register across all epoll instances on the system.  The limit is per "
283 "real user ID.  Each registered file descriptor costs roughly 90 bytes on a "
284 "32-bit kernel, and roughly 160 bytes on a 64-bit kernel.  Currently, the "
285 "default value for I<max_user_watches> is 1/25 (4%) of the available low "
286 "memory, divided by the registration cost in bytes."
287 msgstr ""
288
289 #. type: SS
290 #: build/C/man7/epoll.7:198
291 #, no-wrap
292 msgid "Example for suggested usage"
293 msgstr ""
294
295 #. type: Plain text
296 #: build/C/man7/epoll.7:227
297 msgid ""
298 "While the usage of B<epoll> when employed as a level-triggered interface "
299 "does have the same semantics as B<poll>(2), the edge-triggered usage "
300 "requires more clarification to avoid stalls in the application event loop.  "
301 "In this example, listener is a nonblocking socket on which B<listen>(2)  has "
302 "been called.  The function I<do_use_fd()> uses the new ready file descriptor "
303 "until B<EAGAIN> is returned by either B<read>(2)  or B<write>(2).  An "
304 "event-driven state machine application should, after having received "
305 "B<EAGAIN>, record its current state so that at the next call to "
306 "I<do_use_fd()> it will continue to B<read>(2)  or B<write>(2)  from where it "
307 "stopped before."
308 msgstr ""
309
310 #. type: Plain text
311 #: build/C/man7/epoll.7:233
312 #, no-wrap
313 msgid ""
314 "#define MAX_EVENTS 10\n"
315 "struct epoll_event ev, events[MAX_EVENTS];\n"
316 "int listen_sock, conn_sock, nfds, epollfd;\n"
317 msgstr ""
318
319 #. type: Plain text
320 #: build/C/man7/epoll.7:236
321 #, no-wrap
322 msgid ""
323 "/* Set up listening socket, \\(aqlisten_sock\\(aq (socket(),\n"
324 "   bind(), listen()) */\n"
325 msgstr ""
326
327 #. type: Plain text
328 #: build/C/man7/epoll.7:242
329 #, no-wrap
330 msgid ""
331 "epollfd = epoll_create(10);\n"
332 "if (epollfd == -1) {\n"
333 "    perror(\"epoll_create\");\n"
334 "    exit(EXIT_FAILURE);\n"
335 "}\n"
336 msgstr ""
337
338 #. type: Plain text
339 #: build/C/man7/epoll.7:249
340 #, no-wrap
341 msgid ""
342 "ev.events = EPOLLIN;\n"
343 "ev.data.fd = listen_sock;\n"
344 "if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == -1) {\n"
345 "    perror(\"epoll_ctl: listen_sock\");\n"
346 "    exit(EXIT_FAILURE);\n"
347 "}\n"
348 msgstr ""
349
350 #. type: Plain text
351 #: build/C/man7/epoll.7:256
352 #, no-wrap
353 msgid ""
354 "for (;;) {\n"
355 "    nfds = epoll_wait(epollfd, events, MAX_EVENTS, -1);\n"
356 "    if (nfds == -1) {\n"
357 "        perror(\"epoll_pwait\");\n"
358 "        exit(EXIT_FAILURE);\n"
359 "    }\n"
360 msgstr ""
361
362 #. type: Plain text
363 #: build/C/man7/epoll.7:278
364 #, no-wrap
365 msgid ""
366 "    for (n = 0; n E<lt> nfds; ++n) {\n"
367 "        if (events[n].data.fd == listen_sock) {\n"
368 "            conn_sock = accept(listen_sock,\n"
369 "                            (struct sockaddr *) &local, &addrlen);\n"
370 "            if (conn_sock == -1) {\n"
371 "                perror(\"accept\");\n"
372 "                exit(EXIT_FAILURE);\n"
373 "            }\n"
374 "            setnonblocking(conn_sock);\n"
375 "            ev.events = EPOLLIN | EPOLLET;\n"
376 "            ev.data.fd = conn_sock;\n"
377 "            if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock,\n"
378 "                        &ev) == -1) {\n"
379 "                perror(\"epoll_ctl: conn_sock\");\n"
380 "                exit(EXIT_FAILURE);\n"
381 "            }\n"
382 "        } else {\n"
383 "            do_use_fd(events[n].data.fd);\n"
384 "        }\n"
385 "    }\n"
386 "}\n"
387 msgstr ""
388
389 #. type: Plain text
390 #: build/C/man7/epoll.7:297
391 msgid ""
392 "When used as an edge-triggered interface, for performance reasons, it is "
393 "possible to add the file descriptor inside the B<epoll> interface "
394 "(B<EPOLL_CTL_ADD>)  once by specifying (B<EPOLLIN>|B<EPOLLOUT>).  This "
395 "allows you to avoid continuously switching between B<EPOLLIN> and "
396 "B<EPOLLOUT> calling B<epoll_ctl>(2)  with B<EPOLL_CTL_MOD>."
397 msgstr ""
398
399 #. type: SS
400 #: build/C/man7/epoll.7:297
401 #, no-wrap
402 msgid "Questions and answers"
403 msgstr ""
404
405 #. type: TP
406 #: build/C/man7/epoll.7:298
407 #, no-wrap
408 msgid "B<Q0>"
409 msgstr ""
410
411 #. type: Plain text
412 #: build/C/man7/epoll.7:303
413 msgid ""
414 "What is the key used to distinguish the file descriptors registered in an "
415 "B<epoll> set?"
416 msgstr ""
417
418 #. type: TP
419 #: build/C/man7/epoll.7:303
420 #, no-wrap
421 msgid "B<A0>"
422 msgstr ""
423
424 #. type: Plain text
425 #: build/C/man7/epoll.7:309
426 msgid ""
427 "The key is the combination of the file descriptor number and the open file "
428 "description (also known as an \"open file handle\", the kernel's internal "
429 "representation of an open file)."
430 msgstr ""
431
432 #. type: TP
433 #: build/C/man7/epoll.7:309
434 #, no-wrap
435 msgid "B<Q1>"
436 msgstr ""
437
438 #. type: Plain text
439 #: build/C/man7/epoll.7:314
440 msgid ""
441 "What happens if you register the same file descriptor on an B<epoll> "
442 "instance twice?"
443 msgstr ""
444
445 #. type: TP
446 #: build/C/man7/epoll.7:314
447 #, no-wrap
448 msgid "B<A1>"
449 msgstr ""
450
451 #.  But a descriptor duplicated by fork(2) can't be added to the
452 #.  set, because the [file *, fd] pair is already in the epoll set.
453 #.  That is a somewhat ugly inconsistency.  On the one hand, a child process
454 #.  cannot add the duplicate file descriptor to the epoll set.  (In every
455 #.  other case that I can think of, descriptors duplicated by fork have
456 #.  similar semantics to descriptors duplicated by dup() and friends.)  On
457 #.  the other hand, the very fact that the child has a duplicate of the
458 #.  descriptor means that even if the parent closes its descriptor, then
459 #.  epoll_wait() in the parent will continue to receive notifications for
460 #.  that descriptor because of the duplicated descriptor in the child.
461 #
462 #.  See http://thread.gmane.org/gmane.linux.kernel/596462/
463 #.  "epoll design problems with common fork/exec patterns"
464 #
465 #.  mtk, Feb 2008
466 #. type: Plain text
467 #: build/C/man7/epoll.7:345
468 msgid ""
469 "You will probably get B<EEXIST>.  However, it is possible to add a duplicate "
470 "(B<dup>(2), B<dup2>(2), B<fcntl>(2)  B<F_DUPFD>)  descriptor to the same "
471 "B<epoll> instance.  This can be a useful technique for filtering events, if "
472 "the duplicate file descriptors are registered with different I<events> "
473 "masks."
474 msgstr ""
475
476 #. type: TP
477 #: build/C/man7/epoll.7:345
478 #, no-wrap
479 msgid "B<Q2>"
480 msgstr ""
481
482 #. type: Plain text
483 #: build/C/man7/epoll.7:353
484 msgid ""
485 "Can two B<epoll> instances wait for the same file descriptor? If so, are "
486 "events reported to both B<epoll> file descriptors?"
487 msgstr ""
488
489 #. type: TP
490 #: build/C/man7/epoll.7:353
491 #, no-wrap
492 msgid "B<A2>"
493 msgstr ""
494
495 #. type: Plain text
496 #: build/C/man7/epoll.7:357
497 msgid ""
498 "Yes, and events would be reported to both.  However, careful programming may "
499 "be needed to do this correctly."
500 msgstr ""
501
502 #. type: TP
503 #: build/C/man7/epoll.7:357
504 #, no-wrap
505 msgid "B<Q3>"
506 msgstr ""
507
508 #. type: Plain text
509 #: build/C/man7/epoll.7:362
510 msgid "Is the B<epoll> file descriptor itself poll/epoll/selectable?"
511 msgstr ""
512
513 #. type: TP
514 #: build/C/man7/epoll.7:362
515 #, no-wrap
516 msgid "B<A3>"
517 msgstr ""
518
519 #. type: Plain text
520 #: build/C/man7/epoll.7:369
521 msgid ""
522 "Yes.  If an B<epoll> file descriptor has events waiting then it will "
523 "indicate as being readable."
524 msgstr ""
525
526 #. type: TP
527 #: build/C/man7/epoll.7:369
528 #, no-wrap
529 msgid "B<Q4>"
530 msgstr ""
531
532 #. type: Plain text
533 #: build/C/man7/epoll.7:374
534 msgid ""
535 "What happens if one attempts to put an B<epoll> file descriptor into its own "
536 "file descriptor set?"
537 msgstr ""
538
539 #. type: TP
540 #: build/C/man7/epoll.7:374
541 #, no-wrap
542 msgid "B<A4>"
543 msgstr ""
544
545 #. type: Plain text
546 #: build/C/man7/epoll.7:385
547 msgid ""
548 "The B<epoll_ctl>(2)  call will fail (B<EINVAL>).  However, you can add an "
549 "B<epoll> file descriptor inside another B<epoll> file descriptor set."
550 msgstr ""
551
552 #. type: TP
553 #: build/C/man7/epoll.7:385
554 #, no-wrap
555 msgid "B<Q5>"
556 msgstr ""
557
558 #. type: Plain text
559 #: build/C/man7/epoll.7:390
560 msgid ""
561 "Can I send an B<epoll> file descriptor over a UNIX domain socket to another "
562 "process?"
563 msgstr ""
564
565 #. type: TP
566 #: build/C/man7/epoll.7:390
567 #, no-wrap
568 msgid "B<A5>"
569 msgstr ""
570
571 #. type: Plain text
572 #: build/C/man7/epoll.7:396
573 msgid ""
574 "Yes, but it does not make sense to do this, since the receiving process "
575 "would not have copies of the file descriptors in the B<epoll> set."
576 msgstr ""
577
578 #. type: TP
579 #: build/C/man7/epoll.7:396
580 #, no-wrap
581 msgid "B<Q6>"
582 msgstr ""
583
584 #. type: Plain text
585 #: build/C/man7/epoll.7:401
586 msgid ""
587 "Will closing a file descriptor cause it to be removed from all B<epoll> sets "
588 "automatically?"
589 msgstr ""
590
591 #. type: TP
592 #: build/C/man7/epoll.7:401
593 #, no-wrap
594 msgid "B<A6>"
595 msgstr ""
596
597 #. type: Plain text
598 #: build/C/man7/epoll.7:429
599 msgid ""
600 "Yes, but be aware of the following point.  A file descriptor is a reference "
601 "to an open file description (see B<open>(2)).  Whenever a descriptor is "
602 "duplicated via B<dup>(2), B<dup2>(2), B<fcntl>(2)  B<F_DUPFD>, or "
603 "B<fork>(2), a new file descriptor referring to the same open file "
604 "description is created.  An open file description continues to exist until "
605 "all file descriptors referring to it have been closed.  A file descriptor is "
606 "removed from an B<epoll> set only after all the file descriptors referring "
607 "to the underlying open file description have been closed (or before if the "
608 "descriptor is explicitly removed using B<epoll_ctl>(2)  B<EPOLL_CTL_DEL>).  "
609 "This means that even after a file descriptor that is part of an B<epoll> set "
610 "has been closed, events may be reported for that file descriptor if other "
611 "file descriptors referring to the same underlying file description remain "
612 "open."
613 msgstr ""
614
615 #. type: TP
616 #: build/C/man7/epoll.7:429
617 #, no-wrap
618 msgid "B<Q7>"
619 msgstr ""
620
621 #. type: Plain text
622 #: build/C/man7/epoll.7:434
623 msgid ""
624 "If more than one event occurs between B<epoll_wait>(2)  calls, are they "
625 "combined or reported separately?"
626 msgstr ""
627
628 #. type: TP
629 #: build/C/man7/epoll.7:434
630 #, no-wrap
631 msgid "B<A7>"
632 msgstr ""
633
634 #. type: Plain text
635 #: build/C/man7/epoll.7:437
636 msgid "They will be combined."
637 msgstr ""
638
639 #. type: TP
640 #: build/C/man7/epoll.7:437
641 #, no-wrap
642 msgid "B<Q8>"
643 msgstr ""
644
645 #. type: Plain text
646 #: build/C/man7/epoll.7:441
647 msgid ""
648 "Does an operation on a file descriptor affect the already collected but not "
649 "yet reported events?"
650 msgstr ""
651
652 #. type: TP
653 #: build/C/man7/epoll.7:441
654 #, no-wrap
655 msgid "B<A8>"
656 msgstr ""
657
658 #. type: Plain text
659 #: build/C/man7/epoll.7:447
660 msgid ""
661 "You can do two operations on an existing file descriptor.  Remove would be "
662 "meaningless for this case.  Modify will reread available I/O."
663 msgstr ""
664
665 #. type: TP
666 #: build/C/man7/epoll.7:447
667 #, no-wrap
668 msgid "B<Q9>"
669 msgstr ""
670
671 #. type: Plain text
672 #: build/C/man7/epoll.7:455
673 msgid ""
674 "Do I need to continuously read/write a file descriptor until B<EAGAIN> when "
675 "using the B<EPOLLET> flag (edge-triggered behavior) ?"
676 msgstr ""
677
678 #. type: TP
679 #: build/C/man7/epoll.7:455
680 #, no-wrap
681 msgid "B<A9>"
682 msgstr ""
683
684 #. type: Plain text
685 #: build/C/man7/epoll.7:465
686 msgid ""
687 "Receiving an event from B<epoll_wait>(2)  should suggest to you that such "
688 "file descriptor is ready for the requested I/O operation.  You must consider "
689 "it ready until the next (nonblocking)  read/write yields B<EAGAIN>.  When "
690 "and how you will use the file descriptor is entirely up to you."
691 msgstr ""
692
693 #. type: Plain text
694 #: build/C/man7/epoll.7:471
695 msgid ""
696 "For packet/token-oriented files (e.g., datagram socket, terminal in "
697 "canonical mode), the only way to detect the end of the read/write I/O space "
698 "is to continue to read/write until B<EAGAIN>."
699 msgstr ""
700
701 #. type: Plain text
702 #: build/C/man7/epoll.7:487
703 msgid ""
704 "For stream-oriented files (e.g., pipe, FIFO, stream socket), the condition "
705 "that the read/write I/O space is exhausted can also be detected by checking "
706 "the amount of data read from / written to the target file descriptor.  For "
707 "example, if you call B<read>(2)  by asking to read a certain amount of data "
708 "and B<read>(2)  returns a lower number of bytes, you can be sure of having "
709 "exhausted the read I/O space for the file descriptor.  The same is true when "
710 "writing using B<write>(2).  (Avoid this latter technique if you cannot "
711 "guarantee that the monitored file descriptor always refers to a "
712 "stream-oriented file.)"
713 msgstr ""
714
715 #. type: SS
716 #: build/C/man7/epoll.7:487
717 #, no-wrap
718 msgid "Possible pitfalls and ways to avoid them"
719 msgstr ""
720
721 #. type: TP
722 #: build/C/man7/epoll.7:488
723 #, no-wrap
724 msgid "B<o Starvation (edge-triggered)>"
725 msgstr ""
726
727 #. type: Plain text
728 #: build/C/man7/epoll.7:496
729 msgid ""
730 "If there is a large amount of I/O space, it is possible that by trying to "
731 "drain it the other files will not get processed causing starvation.  (This "
732 "problem is not specific to B<epoll>.)"
733 msgstr ""
734
735 #. type: Plain text
736 #: build/C/man7/epoll.7:504
737 msgid ""
738 "The solution is to maintain a ready list and mark the file descriptor as "
739 "ready in its associated data structure, thereby allowing the application to "
740 "remember which files need to be processed but still round robin amongst all "
741 "the ready files.  This also supports ignoring subsequent events you receive "
742 "for file descriptors that are already ready."
743 msgstr ""
744
745 #. type: TP
746 #: build/C/man7/epoll.7:504
747 #, no-wrap
748 msgid "B<o If using an event cache...>"
749 msgstr ""
750
751 #. type: Plain text
752 #: build/C/man7/epoll.7:520
753 msgid ""
754 "If you use an event cache or store all the file descriptors returned from "
755 "B<epoll_wait>(2), then make sure to provide a way to mark its closure "
756 "dynamically (i.e., caused by a previous event's processing).  Suppose you "
757 "receive 100 events from B<epoll_wait>(2), and in event #47 a condition "
758 "causes event #13 to be closed.  If you remove the structure and B<close>(2)  "
759 "the file descriptor for event #13, then your event cache might still say "
760 "there are events waiting for that file descriptor causing confusion."
761 msgstr ""
762
763 #. type: Plain text
764 #: build/C/man7/epoll.7:531
765 msgid ""
766 "One solution for this is to call, during the processing of event 47, "
767 "B<epoll_ctl>(B<EPOLL_CTL_DEL>)  to delete file descriptor 13 and "
768 "B<close>(2), then mark its associated data structure as removed and link it "
769 "to a cleanup list.  If you find another event for file descriptor 13 in your "
770 "batch processing, you will discover the file descriptor had been previously "
771 "removed and there will be no confusion."
772 msgstr ""
773
774 #. type: SH
775 #: build/C/man7/epoll.7:531 build/C/man2/epoll_create.2:108 build/C/man2/epoll_ctl.2:225 build/C/man2/epoll_wait.2:177 build/C/man2/poll.2:312
776 #, no-wrap
777 msgid "VERSIONS"
778 msgstr ""
779
780 #.  Its interface should be finalized in Linux kernel 2.5.66.
781 #. type: Plain text
782 #: build/C/man7/epoll.7:537
783 msgid ""
784 "The B<epoll> API was introduced in Linux kernel 2.5.44.  Support was added "
785 "to glibc in version 2.3.2."
786 msgstr ""
787
788 #. type: SH
789 #: build/C/man7/epoll.7:537 build/C/man2/epoll_create.2:118 build/C/man2/epoll_ctl.2:230 build/C/man2/epoll_wait.2:187 build/C/man2/poll.2:329
790 #, no-wrap
791 msgid "CONFORMING TO"
792 msgstr ""
793
794 #. type: Plain text
795 #: build/C/man7/epoll.7:546
796 msgid ""
797 "The B<epoll> API is Linux-specific.  Some other systems provide similar "
798 "mechanisms, for example, FreeBSD has I<kqueue>, and Solaris has "
799 "I</dev/poll>."
800 msgstr ""
801
802 #. type: SH
803 #: build/C/man7/epoll.7:546 build/C/man2/epoll_create.2:144 build/C/man2/epoll_ctl.2:253 build/C/man2/epoll_wait.2:219 build/C/man2/poll.2:366
804 #, no-wrap
805 msgid "SEE ALSO"
806 msgstr ""
807
808 #. type: Plain text
809 #: build/C/man7/epoll.7:551
810 msgid "B<epoll_create>(2), B<epoll_create1>(2), B<epoll_ctl>(2), B<epoll_wait>(2)"
811 msgstr ""
812
813 #. type: SH
814 #: build/C/man7/epoll.7:551 build/C/man2/epoll_create.2:149 build/C/man2/epoll_ctl.2:258 build/C/man2/epoll_wait.2:223 build/C/man2/poll.2:371
815 #, no-wrap
816 msgid "COLOPHON"
817 msgstr ""
818
819 #. type: Plain text
820 #: build/C/man7/epoll.7:558 build/C/man2/epoll_create.2:156 build/C/man2/epoll_ctl.2:265 build/C/man2/epoll_wait.2:230 build/C/man2/poll.2:378
821 msgid ""
822 "This page is part of release 3.54 of the Linux I<man-pages> project.  A "
823 "description of the project, and information about reporting bugs, can be "
824 "found at \\%http://www.kernel.org/doc/man-pages/."
825 msgstr ""
826
827 #. type: TH
828 #: build/C/man2/epoll_create.2:24
829 #, no-wrap
830 msgid "EPOLL_CREATE"
831 msgstr ""
832
833 #. type: TH
834 #: build/C/man2/epoll_create.2:24 build/C/man2/epoll_ctl.2:20
835 #, no-wrap
836 msgid "2012-04-15"
837 msgstr ""
838
839 #. type: Plain text
840 #: build/C/man2/epoll_create.2:27
841 msgid "epoll_create, epoll_create1 - open an epoll file descriptor"
842 msgstr ""
843
844 #. type: Plain text
845 #: build/C/man2/epoll_create.2:30 build/C/man2/epoll_wait.2:28
846 #, no-wrap
847 msgid "B<#include E<lt>sys/epoll.hE<gt>>\n"
848 msgstr ""
849
850 #. type: Plain text
851 #: build/C/man2/epoll_create.2:33
852 #, no-wrap
853 msgid ""
854 "B<int epoll_create(int >I<size>B<);>\n"
855 "B<int epoll_create1(int >I<flags>B<);>\n"
856 msgstr ""
857
858 #. type: Plain text
859 #: build/C/man2/epoll_create.2:42
860 msgid ""
861 "B<epoll_create>()  creates an B<epoll>(7)  instance.  Since Linux 2.6.8, the "
862 "I<size> argument is ignored, but must be greater than zero; see NOTES below."
863 msgstr ""
864
865 #. type: Plain text
866 #: build/C/man2/epoll_create.2:55
867 msgid ""
868 "B<epoll_create>()  returns a file descriptor referring to the new epoll "
869 "instance.  This file descriptor is used for all the subsequent calls to the "
870 "B<epoll> interface.  When no longer required, the file descriptor returned "
871 "by B<epoll_create>()  should be closed by using B<close>(2).  When all file "
872 "descriptors referring to an epoll instance have been closed, the kernel "
873 "destroys the instance and releases the associated resources for reuse."
874 msgstr ""
875
876 #. type: SS
877 #: build/C/man2/epoll_create.2:55
878 #, no-wrap
879 msgid "epoll_create1()"
880 msgstr ""
881
882 #. type: Plain text
883 #: build/C/man2/epoll_create.2:67
884 msgid ""
885 "If I<flags> is 0, then, other than the fact that the obsolete I<size> "
886 "argument is dropped, B<epoll_create1>()  is the same as B<epoll_create>().  "
887 "The following value can be included in I<flags> to obtain different "
888 "behavior:"
889 msgstr ""
890
891 #. type: TP
892 #: build/C/man2/epoll_create.2:67
893 #, no-wrap
894 msgid "B<EPOLL_CLOEXEC>"
895 msgstr ""
896
897 #. type: Plain text
898 #: build/C/man2/epoll_create.2:77
899 msgid ""
900 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
901 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
902 "may be useful."
903 msgstr ""
904
905 #. type: SH
906 #: build/C/man2/epoll_create.2:77 build/C/man2/epoll_ctl.2:157 build/C/man2/epoll_wait.2:140 build/C/man2/poll.2:283
907 #, no-wrap
908 msgid "RETURN VALUE"
909 msgstr ""
910
911 #. type: Plain text
912 #: build/C/man2/epoll_create.2:84
913 msgid ""
914 "On success, these system calls return a nonnegative file descriptor.  On "
915 "error, -1 is returned, and I<errno> is set to indicate the error."
916 msgstr ""
917
918 #. type: SH
919 #: build/C/man2/epoll_create.2:84 build/C/man2/epoll_ctl.2:166 build/C/man2/epoll_wait.2:152 build/C/man2/poll.2:293
920 #, no-wrap
921 msgid "ERRORS"
922 msgstr ""
923
924 #. type: TP
925 #: build/C/man2/epoll_create.2:85 build/C/man2/epoll_create.2:89 build/C/man2/epoll_ctl.2:181 build/C/man2/epoll_wait.2:169 build/C/man2/poll.2:302
926 #, no-wrap
927 msgid "B<EINVAL>"
928 msgstr ""
929
930 #. type: Plain text
931 #: build/C/man2/epoll_create.2:89
932 msgid "I<size> is not positive."
933 msgstr ""
934
935 #. type: Plain text
936 #: build/C/man2/epoll_create.2:94
937 msgid "(B<epoll_create1>())  Invalid value specified in I<flags>."
938 msgstr ""
939
940 #. type: TP
941 #: build/C/man2/epoll_create.2:94
942 #, no-wrap
943 msgid "B<EMFILE>"
944 msgstr ""
945
946 #. type: Plain text
947 #: build/C/man2/epoll_create.2:102
948 msgid ""
949 "The per-user limit on the number of epoll instances imposed by "
950 "I</proc/sys/fs/epoll/max_user_instances> was encountered.  See B<epoll>(7)  "
951 "for further details."
952 msgstr ""
953
954 #. type: TP
955 #: build/C/man2/epoll_create.2:102
956 #, no-wrap
957 msgid "B<ENFILE>"
958 msgstr ""
959
960 #. type: Plain text
961 #: build/C/man2/epoll_create.2:105
962 msgid "The system limit on the total number of open files has been reached."
963 msgstr ""
964
965 #. type: TP
966 #: build/C/man2/epoll_create.2:105 build/C/man2/epoll_ctl.2:204 build/C/man2/poll.2:309
967 #, no-wrap
968 msgid "B<ENOMEM>"
969 msgstr ""
970
971 #. type: Plain text
972 #: build/C/man2/epoll_create.2:108
973 msgid "There was insufficient memory to create the kernel object."
974 msgstr ""
975
976 #. type: Plain text
977 #: build/C/man2/epoll_create.2:112
978 msgid ""
979 "B<epoll_create>()  was added to the kernel in version 2.6.  Library support "
980 "is provided in glibc starting with version 2.3.2."
981 msgstr ""
982
983 #.  To be precise: kernel 2.5.44.
984 #.  The interface should be finalized by Linux kernel 2.5.66.
985 #. type: Plain text
986 #: build/C/man2/epoll_create.2:118
987 msgid ""
988 "B<epoll_create1>()  was added to the kernel in version 2.6.27.  Library "
989 "support is provided in glibc starting with version 2.9."
990 msgstr ""
991
992 #. type: Plain text
993 #: build/C/man2/epoll_create.2:121
994 msgid "B<epoll_create>()  is Linux-specific."
995 msgstr ""
996
997 #. type: SH
998 #: build/C/man2/epoll_create.2:121 build/C/man2/epoll_ctl.2:234 build/C/man2/epoll_wait.2:190 build/C/man2/poll.2:335
999 #, no-wrap
1000 msgid "NOTES"
1001 msgstr ""
1002
1003 #. type: Plain text
1004 #: build/C/man2/epoll_create.2:144
1005 msgid ""
1006 "In the initial B<epoll_create>()  implementation, the I<size> argument "
1007 "informed the kernel of the number of file descriptors that the caller "
1008 "expected to add to the B<epoll> instance.  The kernel used this information "
1009 "as a hint for the amount of space to initially allocate in internal data "
1010 "structures describing events.  (If necessary, the kernel would allocate more "
1011 "space if the caller's usage exceeded the hint given in I<size>.)  Nowadays, "
1012 "this hint is no longer required (the kernel dynamically sizes the required "
1013 "data structures without needing the hint), but I<size> must still be greater "
1014 "than zero, in order to ensure backward compatibility when new B<epoll> "
1015 "applications are run on older kernels."
1016 msgstr ""
1017
1018 #. type: Plain text
1019 #: build/C/man2/epoll_create.2:149
1020 msgid "B<close>(2), B<epoll_ctl>(2), B<epoll_wait>(2), B<epoll>(7)"
1021 msgstr ""
1022
1023 #. type: TH
1024 #: build/C/man2/epoll_ctl.2:20
1025 #, no-wrap
1026 msgid "EPOLL_CTL"
1027 msgstr ""
1028
1029 #. type: Plain text
1030 #: build/C/man2/epoll_ctl.2:23
1031 msgid "epoll_ctl - control interface for an epoll descriptor"
1032 msgstr ""
1033
1034 #. type: Plain text
1035 #: build/C/man2/epoll_ctl.2:28
1036 msgid ""
1037 "B<int epoll_ctl(int >I<epfd>B<, int >I<op>B<, int >I<fd>B<, struct "
1038 "epoll_event *>I<event>B<);>"
1039 msgstr ""
1040
1041 #. type: Plain text
1042 #: build/C/man2/epoll_ctl.2:38
1043 msgid ""
1044 "This system call performs control operations on the B<epoll>(7)  instance "
1045 "referred to by the file descriptor I<epfd>.  It requests that the operation "
1046 "I<op> be performed for the target file descriptor, I<fd>."
1047 msgstr ""
1048
1049 #. type: Plain text
1050 #: build/C/man2/epoll_ctl.2:42
1051 msgid "Valid values for the I<op> argument are :"
1052 msgstr ""
1053
1054 #. type: TP
1055 #: build/C/man2/epoll_ctl.2:42
1056 #, no-wrap
1057 msgid "B<EPOLL_CTL_ADD>"
1058 msgstr ""
1059
1060 #. type: Plain text
1061 #: build/C/man2/epoll_ctl.2:54
1062 msgid ""
1063 "Register the target file descriptor I<fd> on the B<epoll> instance referred "
1064 "to by the file descriptor I<epfd> and associate the event I<event> with the "
1065 "internal file linked to I<fd>."
1066 msgstr ""
1067
1068 #. type: TP
1069 #: build/C/man2/epoll_ctl.2:54
1070 #, no-wrap
1071 msgid "B<EPOLL_CTL_MOD>"
1072 msgstr ""
1073
1074 #. type: Plain text
1075 #: build/C/man2/epoll_ctl.2:60
1076 msgid "Change the event I<event> associated with the target file descriptor I<fd>."
1077 msgstr ""
1078
1079 #. type: TP
1080 #: build/C/man2/epoll_ctl.2:60
1081 #, no-wrap
1082 msgid "B<EPOLL_CTL_DEL>"
1083 msgstr ""
1084
1085 #. type: Plain text
1086 #: build/C/man2/epoll_ctl.2:71
1087 msgid ""
1088 "Remove (deregister) the target file descriptor I<fd> from the B<epoll> "
1089 "instance referred to by I<epfd>.  The I<event> is ignored and can be NULL "
1090 "(but see BUGS below)."
1091 msgstr ""
1092
1093 #. type: Plain text
1094 #: build/C/man2/epoll_ctl.2:79
1095 msgid ""
1096 "The I<event> argument describes the object linked to the file descriptor "
1097 "I<fd>.  The I<struct epoll_event> is defined as :"
1098 msgstr ""
1099
1100 #. type: Plain text
1101 #: build/C/man2/epoll_ctl.2:88
1102 #, no-wrap
1103 msgid ""
1104 "typedef union epoll_data {\n"
1105 "    void        *ptr;\n"
1106 "    int          fd;\n"
1107 "    uint32_t     u32;\n"
1108 "    uint64_t     u64;\n"
1109 "} epoll_data_t;\n"
1110 msgstr ""
1111
1112 #. type: Plain text
1113 #: build/C/man2/epoll_ctl.2:93
1114 #, no-wrap
1115 msgid ""
1116 "struct epoll_event {\n"
1117 "    uint32_t     events;      /* Epoll events */\n"
1118 "    epoll_data_t data;        /* User data variable */\n"
1119 "};\n"
1120 msgstr ""
1121
1122 #. type: Plain text
1123 #: build/C/man2/epoll_ctl.2:100
1124 msgid ""
1125 "The I<events> member is a bit set composed using the following available "
1126 "event types:"
1127 msgstr ""
1128
1129 #. type: TP
1130 #: build/C/man2/epoll_ctl.2:100
1131 #, no-wrap
1132 msgid "B<EPOLLIN>"
1133 msgstr ""
1134
1135 #. type: Plain text
1136 #: build/C/man2/epoll_ctl.2:105
1137 msgid "The associated file is available for B<read>(2)  operations."
1138 msgstr ""
1139
1140 #. type: TP
1141 #: build/C/man2/epoll_ctl.2:105
1142 #, no-wrap
1143 msgid "B<EPOLLOUT>"
1144 msgstr ""
1145
1146 #. type: Plain text
1147 #: build/C/man2/epoll_ctl.2:110
1148 msgid "The associated file is available for B<write>(2)  operations."
1149 msgstr ""
1150
1151 #. type: TP
1152 #: build/C/man2/epoll_ctl.2:110
1153 #, no-wrap
1154 msgid "B<EPOLLRDHUP> (since Linux 2.6.17)"
1155 msgstr ""
1156
1157 #. type: Plain text
1158 #: build/C/man2/epoll_ctl.2:116
1159 msgid ""
1160 "Stream socket peer closed connection, or shut down writing half of "
1161 "connection.  (This flag is especially useful for writing simple code to "
1162 "detect peer shutdown when using Edge Triggered monitoring.)"
1163 msgstr ""
1164
1165 #. type: TP
1166 #: build/C/man2/epoll_ctl.2:116
1167 #, no-wrap
1168 msgid "B<EPOLLPRI>"
1169 msgstr ""
1170
1171 #. type: Plain text
1172 #: build/C/man2/epoll_ctl.2:121
1173 msgid "There is urgent data available for B<read>(2)  operations."
1174 msgstr ""
1175
1176 #. type: TP
1177 #: build/C/man2/epoll_ctl.2:121
1178 #, no-wrap
1179 msgid "B<EPOLLERR>"
1180 msgstr ""
1181
1182 #. type: Plain text
1183 #: build/C/man2/epoll_ctl.2:127
1184 msgid ""
1185 "Error condition happened on the associated file descriptor.  "
1186 "B<epoll_wait>(2)  will always wait for this event; it is not necessary to "
1187 "set it in I<events>."
1188 msgstr ""
1189
1190 #. type: TP
1191 #: build/C/man2/epoll_ctl.2:127
1192 #, no-wrap
1193 msgid "B<EPOLLHUP>"
1194 msgstr ""
1195
1196 #. type: Plain text
1197 #: build/C/man2/epoll_ctl.2:133
1198 msgid ""
1199 "Hang up happened on the associated file descriptor.  B<epoll_wait>(2)  will "
1200 "always wait for this event; it is not necessary to set it in I<events>."
1201 msgstr ""
1202
1203 #. type: TP
1204 #: build/C/man2/epoll_ctl.2:133
1205 #, no-wrap
1206 msgid "B<EPOLLET>"
1207 msgstr ""
1208
1209 #. type: Plain text
1210 #: build/C/man2/epoll_ctl.2:143
1211 msgid ""
1212 "Sets the Edge Triggered behavior for the associated file descriptor.  The "
1213 "default behavior for B<epoll> is Level Triggered.  See B<epoll>(7)  for more "
1214 "detailed information about Edge and Level Triggered event distribution "
1215 "architectures."
1216 msgstr ""
1217
1218 #. type: TP
1219 #: build/C/man2/epoll_ctl.2:143
1220 #, no-wrap
1221 msgid "B<EPOLLONESHOT> (since Linux 2.6.2)"
1222 msgstr ""
1223
1224 #. type: Plain text
1225 #: build/C/man2/epoll_ctl.2:157
1226 msgid ""
1227 "Sets the one-shot behavior for the associated file descriptor.  This means "
1228 "that after an event is pulled out with B<epoll_wait>(2)  the associated file "
1229 "descriptor is internally disabled and no other events will be reported by "
1230 "the B<epoll> interface.  The user must call B<epoll_ctl>()  with "
1231 "B<EPOLL_CTL_MOD> to rearm the file descriptor with a new event mask."
1232 msgstr ""
1233
1234 #. type: Plain text
1235 #: build/C/man2/epoll_ctl.2:166
1236 msgid ""
1237 "When successful, B<epoll_ctl>()  returns zero.  When an error occurs, "
1238 "B<epoll_ctl>()  returns -1 and I<errno> is set appropriately."
1239 msgstr ""
1240
1241 #. type: TP
1242 #: build/C/man2/epoll_ctl.2:167 build/C/man2/epoll_wait.2:153
1243 #, no-wrap
1244 msgid "B<EBADF>"
1245 msgstr ""
1246
1247 #. type: Plain text
1248 #: build/C/man2/epoll_ctl.2:173
1249 msgid "I<epfd> or I<fd> is not a valid file descriptor."
1250 msgstr ""
1251
1252 #. type: TP
1253 #: build/C/man2/epoll_ctl.2:173
1254 #, no-wrap
1255 msgid "B<EEXIST>"
1256 msgstr ""
1257
1258 #. type: Plain text
1259 #: build/C/man2/epoll_ctl.2:181
1260 msgid ""
1261 "I<op> was B<EPOLL_CTL_ADD>, and the supplied file descriptor I<fd> is "
1262 "already registered with this epoll instance."
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man2/epoll_ctl.2:194
1267 msgid ""
1268 "I<epfd> is not an B<epoll> file descriptor, or I<fd> is the same as I<epfd>, "
1269 "or the requested operation I<op> is not supported by this interface."
1270 msgstr ""
1271
1272 #. type: TP
1273 #: build/C/man2/epoll_ctl.2:194
1274 #, no-wrap
1275 msgid "B<ENOENT>"
1276 msgstr ""
1277
1278 #. type: Plain text
1279 #: build/C/man2/epoll_ctl.2:204
1280 msgid ""
1281 "I<op> was B<EPOLL_CTL_MOD> or B<EPOLL_CTL_DEL>, and I<fd> is not registered "
1282 "with this epoll instance."
1283 msgstr ""
1284
1285 #. type: Plain text
1286 #: build/C/man2/epoll_ctl.2:209
1287 msgid ""
1288 "There was insufficient memory to handle the requested I<op> control "
1289 "operation."
1290 msgstr ""
1291
1292 #. type: TP
1293 #: build/C/man2/epoll_ctl.2:209
1294 #, no-wrap
1295 msgid "B<ENOSPC>"
1296 msgstr ""
1297
1298 #. type: Plain text
1299 #: build/C/man2/epoll_ctl.2:219
1300 msgid ""
1301 "The limit imposed by I</proc/sys/fs/epoll/max_user_watches> was encountered "
1302 "while trying to register (B<EPOLL_CTL_ADD>)  a new file descriptor on an "
1303 "epoll instance.  See B<epoll>(7)  for further details."
1304 msgstr ""
1305
1306 #. type: TP
1307 #: build/C/man2/epoll_ctl.2:219
1308 #, no-wrap
1309 msgid "B<EPERM>"
1310 msgstr ""
1311
1312 #. type: Plain text
1313 #: build/C/man2/epoll_ctl.2:225
1314 msgid "The target file I<fd> does not support B<epoll>."
1315 msgstr ""
1316
1317 #.  To be precise: kernel 2.5.44.
1318 #.  The interface should be finalized by Linux kernel 2.5.66.
1319 #. type: Plain text
1320 #: build/C/man2/epoll_ctl.2:230
1321 msgid "B<epoll_ctl>()  was added to the kernel in version 2.6."
1322 msgstr ""
1323
1324 #. type: Plain text
1325 #: build/C/man2/epoll_ctl.2:234
1326 msgid ""
1327 "B<epoll_ctl>()  is Linux-specific.  Library support is provided in glibc "
1328 "starting with version 2.3.2."
1329 msgstr ""
1330
1331 #. type: Plain text
1332 #: build/C/man2/epoll_ctl.2:239
1333 msgid ""
1334 "The B<epoll> interface supports all file descriptors that support "
1335 "B<poll>(2)."
1336 msgstr ""
1337
1338 #. type: SH
1339 #: build/C/man2/epoll_ctl.2:239 build/C/man2/epoll_wait.2:207 build/C/man2/poll.2:362
1340 #, no-wrap
1341 msgid "BUGS"
1342 msgstr ""
1343
1344 #. type: Plain text
1345 #: build/C/man2/epoll_ctl.2:253
1346 msgid ""
1347 "In kernel versions before 2.6.9, the B<EPOLL_CTL_DEL> operation required a "
1348 "non-NULL pointer in I<event>, even though this argument is ignored.  Since "
1349 "Linux 2.6.9, I<event> can be specified as NULL when using B<EPOLL_CTL_DEL>.  "
1350 "Applications that need to be portable to kernels before 2.6.9 should specify "
1351 "a non-NULL pointer in I<event>."
1352 msgstr ""
1353
1354 #. type: Plain text
1355 #: build/C/man2/epoll_ctl.2:258
1356 msgid "B<epoll_create>(2), B<epoll_wait>(2), B<poll>(2), B<epoll>(7)"
1357 msgstr ""
1358
1359 #. type: TH
1360 #: build/C/man2/epoll_wait.2:22
1361 #, no-wrap
1362 msgid "EPOLL_WAIT"
1363 msgstr ""
1364
1365 #. type: TH
1366 #: build/C/man2/epoll_wait.2:22
1367 #, no-wrap
1368 msgid "2012-08-17"
1369 msgstr ""
1370
1371 #. type: Plain text
1372 #: build/C/man2/epoll_wait.2:25
1373 msgid "epoll_wait, epoll_pwait - wait for an I/O event on an epoll file descriptor"
1374 msgstr ""
1375
1376 #. type: Plain text
1377 #: build/C/man2/epoll_wait.2:34
1378 #, no-wrap
1379 msgid ""
1380 "B<int epoll_wait(int >I<epfd>B<, struct epoll_event *>I<events>B<,>\n"
1381 "B<               int >I<maxevents>B<, int >I<timeout>B<);>\n"
1382 "B<int epoll_pwait(int >I<epfd>B<, struct epoll_event *>I<events>B<,>\n"
1383 "B<               int >I<maxevents>B<, int >I<timeout>B<,>\n"
1384 "B<               const sigset_t *>I<sigmask>B<);>\n"
1385 msgstr ""
1386
1387 #. type: Plain text
1388 #: build/C/man2/epoll_wait.2:52
1389 msgid ""
1390 "The B<epoll_wait>()  system call waits for events on the B<epoll>(7)  "
1391 "instance referred to by the file descriptor I<epfd>.  The memory area "
1392 "pointed to by I<events> will contain the events that will be available for "
1393 "the caller.  Up to I<maxevents> are returned by B<epoll_wait>().  The "
1394 "I<maxevents> argument must be greater than zero."
1395 msgstr ""
1396
1397 #. type: Plain text
1398 #: build/C/man2/epoll_wait.2:70
1399 msgid ""
1400 "The I<timeout> argument specifies the minimum number of milliseconds that "
1401 "B<epoll_wait>()  will block.  (This interval will be rounded up to the "
1402 "system clock granularity, and kernel scheduling delays mean that the "
1403 "blocking interval may overrun by a small amount.)  Specifying a I<timeout> "
1404 "of -1 causes B<epoll_wait>()  to block indefinitely, while specifying a "
1405 "I<timeout> equal to zero cause B<epoll_wait>()  to return immediately, even "
1406 "if no events are available."
1407 msgstr ""
1408
1409 #. type: Plain text
1410 #: build/C/man2/epoll_wait.2:74
1411 msgid "The I<struct epoll_event> is defined as :"
1412 msgstr ""
1413
1414 #. type: Plain text
1415 #: build/C/man2/epoll_wait.2:83
1416 #, no-wrap
1417 msgid ""
1418 "typedef union epoll_data {\n"
1419 "    void    *ptr;\n"
1420 "    int      fd;\n"
1421 "    uint32_t u32;\n"
1422 "    uint64_t u64;\n"
1423 "} epoll_data_t;\n"
1424 msgstr ""
1425
1426 #. type: Plain text
1427 #: build/C/man2/epoll_wait.2:88
1428 #, no-wrap
1429 msgid ""
1430 "struct epoll_event {\n"
1431 "    uint32_t     events;    /* Epoll events */\n"
1432 "    epoll_data_t data;      /* User data variable */\n"
1433 "};\n"
1434 msgstr ""
1435
1436 #. type: Plain text
1437 #: build/C/man2/epoll_wait.2:99
1438 msgid ""
1439 "The I<data> of each returned structure will contain the same data the user "
1440 "set with an B<epoll_ctl>(2)  (B<EPOLL_CTL_ADD>, B<EPOLL_CTL_MOD>)  while the "
1441 "I<events> member will contain the returned event bit field."
1442 msgstr ""
1443
1444 #. type: SS
1445 #: build/C/man2/epoll_wait.2:99
1446 #, no-wrap
1447 msgid "epoll_pwait()"
1448 msgstr ""
1449
1450 #. type: Plain text
1451 #: build/C/man2/epoll_wait.2:113
1452 msgid ""
1453 "The relationship between B<epoll_wait>()  and B<epoll_pwait>()  is analogous "
1454 "to the relationship between B<select>(2)  and B<pselect>(2): like "
1455 "B<pselect>(2), B<epoll_pwait>()  allows an application to safely wait until "
1456 "either a file descriptor becomes ready or until a signal is caught."
1457 msgstr ""
1458
1459 #. type: Plain text
1460 #: build/C/man2/epoll_wait.2:117
1461 msgid "The following B<epoll_pwait>()  call:"
1462 msgstr ""
1463
1464 #. type: Plain text
1465 #: build/C/man2/epoll_wait.2:120
1466 #, no-wrap
1467 msgid "    ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask);\n"
1468 msgstr ""
1469
1470 #. type: Plain text
1471 #: build/C/man2/epoll_wait.2:125 build/C/man2/poll.2:232
1472 msgid "is equivalent to I<atomically> executing the following calls:"
1473 msgstr ""
1474
1475 #. type: Plain text
1476 #: build/C/man2/epoll_wait.2:128
1477 #, no-wrap
1478 msgid "    sigset_t origmask;\n"
1479 msgstr ""
1480
1481 #. type: Plain text
1482 #: build/C/man2/epoll_wait.2:132
1483 #, no-wrap
1484 msgid ""
1485 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
1486 "    ready = epoll_wait(epfd, &events, maxevents, timeout);\n"
1487 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
1488 msgstr ""
1489
1490 #. type: Plain text
1491 #: build/C/man2/epoll_wait.2:140
1492 msgid ""
1493 "The I<sigmask> argument may be specified as NULL, in which case "
1494 "B<epoll_pwait>()  is equivalent to B<epoll_wait>()."
1495 msgstr ""
1496
1497 #. type: Plain text
1498 #: build/C/man2/epoll_wait.2:152
1499 msgid ""
1500 "When successful, B<epoll_wait>()  returns the number of file descriptors "
1501 "ready for the requested I/O, or zero if no file descriptor became ready "
1502 "during the requested I<timeout> milliseconds.  When an error occurs, "
1503 "B<epoll_wait>()  returns -1 and I<errno> is set appropriately."
1504 msgstr ""
1505
1506 #. type: Plain text
1507 #: build/C/man2/epoll_wait.2:157
1508 msgid "I<epfd> is not a valid file descriptor."
1509 msgstr ""
1510
1511 #. type: TP
1512 #: build/C/man2/epoll_wait.2:157 build/C/man2/poll.2:294
1513 #, no-wrap
1514 msgid "B<EFAULT>"
1515 msgstr ""
1516
1517 #. type: Plain text
1518 #: build/C/man2/epoll_wait.2:162
1519 msgid ""
1520 "The memory area pointed to by I<events> is not accessible with write "
1521 "permissions."
1522 msgstr ""
1523
1524 #. type: TP
1525 #: build/C/man2/epoll_wait.2:162 build/C/man2/poll.2:298
1526 #, no-wrap
1527 msgid "B<EINTR>"
1528 msgstr ""
1529
1530 #. type: Plain text
1531 #: build/C/man2/epoll_wait.2:169
1532 msgid ""
1533 "The call was interrupted by a signal handler before either any of the "
1534 "requested events occurred or the I<timeout> expired; see B<signal>(7)."
1535 msgstr ""
1536
1537 #. type: Plain text
1538 #: build/C/man2/epoll_wait.2:177
1539 msgid ""
1540 "I<epfd> is not an B<epoll> file descriptor, or I<maxevents> is less than or "
1541 "equal to zero."
1542 msgstr ""
1543
1544 #.  To be precise: kernel 2.5.44.
1545 #.  The interface should be finalized by Linux kernel 2.5.66.
1546 #. type: Plain text
1547 #: build/C/man2/epoll_wait.2:183
1548 msgid ""
1549 "B<epoll_wait>()  was added to the kernel in version 2.6.  Library support is "
1550 "provided in glibc starting with version 2.3.2."
1551 msgstr ""
1552
1553 #. type: Plain text
1554 #: build/C/man2/epoll_wait.2:187
1555 msgid ""
1556 "B<epoll_pwait>()  was added to Linux in kernel 2.6.19.  Library support is "
1557 "provided in glibc starting with version 2.6."
1558 msgstr ""
1559
1560 #. type: Plain text
1561 #: build/C/man2/epoll_wait.2:190
1562 msgid "B<epoll_wait>()  is Linux-specific."
1563 msgstr ""
1564
1565 #. type: Plain text
1566 #: build/C/man2/epoll_wait.2:200
1567 msgid ""
1568 "While one thread is blocked in a call to B<epoll_pwait>(), it is possible "
1569 "for another thread to add a file descriptor to the waited-upon B<epoll> "
1570 "instance.  If the new file descriptor becomes ready, it will cause the "
1571 "B<epoll_wait>()  call to unblock."
1572 msgstr ""
1573
1574 #. type: Plain text
1575 #: build/C/man2/epoll_wait.2:207
1576 msgid ""
1577 "For a discussion of what may happen if a file descriptor in an B<epoll> "
1578 "instance being monitored by B<epoll_wait>()  is closed in another thread, "
1579 "see B<select>(2)."
1580 msgstr ""
1581
1582 #. type: Plain text
1583 #: build/C/man2/epoll_wait.2:219
1584 msgid ""
1585 "In kernels before 2.6.37, a I<timeout> value larger than approximately "
1586 "I<LONG_MAX / HZ> milliseconds is treated as -1 (i.e., infinity).  Thus, for "
1587 "example, on a system where the I<sizeof(long)> is 4 and the kernel I<HZ> "
1588 "value is 1000, this means that timeouts greater than 35.79 minutes are "
1589 "treated as infinity."
1590 msgstr ""
1591
1592 #. type: Plain text
1593 #: build/C/man2/epoll_wait.2:223
1594 msgid "B<epoll_create>(2), B<epoll_ctl>(2), B<epoll>(7)"
1595 msgstr ""
1596
1597 #. type: TH
1598 #: build/C/man2/poll.2:31
1599 #, no-wrap
1600 msgid "POLL"
1601 msgstr ""
1602
1603 #. type: TH
1604 #: build/C/man2/poll.2:31
1605 #, no-wrap
1606 msgid "2013-09-04"
1607 msgstr ""
1608
1609 #. type: Plain text
1610 #: build/C/man2/poll.2:34
1611 msgid "poll, ppoll - wait for some event on a file descriptor"
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man2/poll.2:37
1616 #, no-wrap
1617 msgid "B<#include E<lt>poll.hE<gt>>\n"
1618 msgstr ""
1619
1620 #. type: Plain text
1621 #: build/C/man2/poll.2:39
1622 #, no-wrap
1623 msgid ""
1624 "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int "
1625 ">I<timeout>B<);>\n"
1626 msgstr ""
1627
1628 #. type: Plain text
1629 #: build/C/man2/poll.2:42
1630 #, no-wrap
1631 msgid ""
1632 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
1633 "B<#include E<lt>poll.hE<gt>>\n"
1634 msgstr ""
1635
1636 #. type: Plain text
1637 #: build/C/man2/poll.2:45
1638 #, no-wrap
1639 msgid ""
1640 "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, >\n"
1641 "B<        const struct timespec *>I<timeout_ts>B<, const sigset_t "
1642 "*>I<sigmask>B<);>\n"
1643 msgstr ""
1644
1645 #. type: Plain text
1646 #: build/C/man2/poll.2:52
1647 msgid ""
1648 "B<poll>()  performs a similar task to B<select>(2): it waits for one of a "
1649 "set of file descriptors to become ready to perform I/O."
1650 msgstr ""
1651
1652 #. type: Plain text
1653 #: build/C/man2/poll.2:56
1654 msgid ""
1655 "The set of file descriptors to be monitored is specified in the I<fds> "
1656 "argument, which is an array of structures of the following form:"
1657 msgstr ""
1658
1659 #. type: Plain text
1660 #: build/C/man2/poll.2:64
1661 #, no-wrap
1662 msgid ""
1663 "struct pollfd {\n"
1664 "    int   fd;         /* file descriptor */\n"
1665 "    short events;     /* requested events */\n"
1666 "    short revents;    /* returned events */\n"
1667 "};\n"
1668 msgstr ""
1669
1670 #. type: Plain text
1671 #: build/C/man2/poll.2:71
1672 msgid ""
1673 "The caller should specify the number of items in the I<fds> array in "
1674 "I<nfds>."
1675 msgstr ""
1676
1677 #. type: Plain text
1678 #: build/C/man2/poll.2:86
1679 msgid ""
1680 "The field I<fd> contains a file descriptor for an open file.  If this field "
1681 "is negative, then the corresponding I<events> field is ignored and the "
1682 "I<revents> field returns zero.  (This provides an easy way of ignoring a "
1683 "file descriptor for a single B<poll>()  call: simply negate the I<fd> "
1684 "field.)"
1685 msgstr ""
1686
1687 #. type: Plain text
1688 #: build/C/man2/poll.2:98
1689 msgid ""
1690 "The field I<events> is an input parameter, a bit mask specifying the events "
1691 "the application is interested in for the file descriptor I<fd>.  If this "
1692 "field is specified as zero, then all events are ignored for I<fd> and "
1693 "I<revents> returns zero."
1694 msgstr ""
1695
1696 #. type: Plain text
1697 #: build/C/man2/poll.2:117
1698 msgid ""
1699 "The field I<revents> is an output parameter, filled by the kernel with the "
1700 "events that actually occurred.  The bits returned in I<revents> can include "
1701 "any of those specified in I<events>, or one of the values B<POLLERR>, "
1702 "B<POLLHUP>, or B<POLLNVAL>.  (These three bits are meaningless in the "
1703 "I<events> field, and will be set in the I<revents> field whenever the "
1704 "corresponding condition is true.)"
1705 msgstr ""
1706
1707 #. type: Plain text
1708 #: build/C/man2/poll.2:122
1709 msgid ""
1710 "If none of the events requested (and no error) has occurred for any of the "
1711 "file descriptors, then B<poll>()  blocks until one of the events occurs."
1712 msgstr ""
1713
1714 #. type: Plain text
1715 #: build/C/man2/poll.2:139
1716 msgid ""
1717 "The I<timeout> argument specifies the number of milliseconds that B<poll>()  "
1718 "should block waiting for a file descriptor to become ready.  This interval "
1719 "will be rounded up to the system clock granularity, and kernel scheduling "
1720 "delays mean that the blocking interval may overrun by a small amount.  "
1721 "Specifying a negative value in I<timeout> means an infinite timeout.  "
1722 "Specifying a I<timeout> of zero causes B<poll>()  to return immediately, "
1723 "even if no file descriptors are ready."
1724 msgstr ""
1725
1726 #. type: Plain text
1727 #: build/C/man2/poll.2:145
1728 msgid ""
1729 "The bits that may be set/returned in I<events> and I<revents> are defined in "
1730 "I<E<lt>poll.hE<gt>>:"
1731 msgstr ""
1732
1733 #. type: TP
1734 #: build/C/man2/poll.2:146
1735 #, no-wrap
1736 msgid "B<POLLIN>"
1737 msgstr ""
1738
1739 #. type: Plain text
1740 #: build/C/man2/poll.2:149
1741 msgid "There is data to read."
1742 msgstr ""
1743
1744 #. type: TP
1745 #: build/C/man2/poll.2:149
1746 #, no-wrap
1747 msgid "B<POLLPRI>"
1748 msgstr ""
1749
1750 #. type: Plain text
1751 #: build/C/man2/poll.2:153
1752 msgid ""
1753 "There is urgent data to read (e.g., out-of-band data on TCP socket; "
1754 "pseudoterminal master in packet mode has seen state change in slave)."
1755 msgstr ""
1756
1757 #. type: TP
1758 #: build/C/man2/poll.2:153
1759 #, no-wrap
1760 msgid "B<POLLOUT>"
1761 msgstr ""
1762
1763 #. type: Plain text
1764 #: build/C/man2/poll.2:156
1765 msgid "Writing now will not block."
1766 msgstr ""
1767
1768 #. type: TP
1769 #: build/C/man2/poll.2:156
1770 #, no-wrap
1771 msgid "B<POLLRDHUP> (since Linux 2.6.17)"
1772 msgstr ""
1773
1774 #. type: Plain text
1775 #: build/C/man2/poll.2:167
1776 msgid ""
1777 "Stream socket peer closed connection, or shut down writing half of "
1778 "connection.  The B<_GNU_SOURCE> feature test macro must be defined (before "
1779 "including I<any> header files)  in order to obtain this definition."
1780 msgstr ""
1781
1782 #. type: TP
1783 #: build/C/man2/poll.2:167
1784 #, no-wrap
1785 msgid "B<POLLERR>"
1786 msgstr ""
1787
1788 #. type: Plain text
1789 #: build/C/man2/poll.2:170
1790 msgid "Error condition (output only)."
1791 msgstr ""
1792
1793 #. type: TP
1794 #: build/C/man2/poll.2:170
1795 #, no-wrap
1796 msgid "B<POLLHUP>"
1797 msgstr ""
1798
1799 #. type: Plain text
1800 #: build/C/man2/poll.2:173
1801 msgid "Hang up (output only)."
1802 msgstr ""
1803
1804 #. type: TP
1805 #: build/C/man2/poll.2:173
1806 #, no-wrap
1807 msgid "B<POLLNVAL>"
1808 msgstr ""
1809
1810 #. type: Plain text
1811 #: build/C/man2/poll.2:178
1812 msgid "Invalid request: I<fd> not open (output only)."
1813 msgstr ""
1814
1815 #. type: Plain text
1816 #: build/C/man2/poll.2:184
1817 msgid ""
1818 "When compiling with B<_XOPEN_SOURCE> defined, one also has the following, "
1819 "which convey no further information beyond the bits listed above:"
1820 msgstr ""
1821
1822 #. type: TP
1823 #: build/C/man2/poll.2:185
1824 #, no-wrap
1825 msgid "B<POLLRDNORM>"
1826 msgstr ""
1827
1828 #. type: Plain text
1829 #: build/C/man2/poll.2:189
1830 msgid "Equivalent to B<POLLIN>."
1831 msgstr ""
1832
1833 #. type: TP
1834 #: build/C/man2/poll.2:189
1835 #, no-wrap
1836 msgid "B<POLLRDBAND>"
1837 msgstr ""
1838
1839 #.  POLLRDBAND is used in the DECnet protocol.
1840 #. type: Plain text
1841 #: build/C/man2/poll.2:193
1842 msgid "Priority band data can be read (generally unused on Linux)."
1843 msgstr ""
1844
1845 #. type: TP
1846 #: build/C/man2/poll.2:193
1847 #, no-wrap
1848 msgid "B<POLLWRNORM>"
1849 msgstr ""
1850
1851 #. type: Plain text
1852 #: build/C/man2/poll.2:197
1853 msgid "Equivalent to B<POLLOUT>."
1854 msgstr ""
1855
1856 #. type: TP
1857 #: build/C/man2/poll.2:197
1858 #, no-wrap
1859 msgid "B<POLLWRBAND>"
1860 msgstr ""
1861
1862 #. type: Plain text
1863 #: build/C/man2/poll.2:200
1864 msgid "Priority data may be written."
1865 msgstr ""
1866
1867 #. type: Plain text
1868 #: build/C/man2/poll.2:204
1869 msgid "Linux also knows about, but does not use B<POLLMSG>."
1870 msgstr ""
1871
1872 #. type: SS
1873 #: build/C/man2/poll.2:204
1874 #, no-wrap
1875 msgid "ppoll()"
1876 msgstr ""
1877
1878 #. type: Plain text
1879 #: build/C/man2/poll.2:218
1880 msgid ""
1881 "The relationship between B<poll>()  and B<ppoll>()  is analogous to the "
1882 "relationship between B<select>(2)  and B<pselect>(2): like B<pselect>(2), "
1883 "B<ppoll>()  allows an application to safely wait until either a file "
1884 "descriptor becomes ready or until a signal is caught."
1885 msgstr ""
1886
1887 #. type: Plain text
1888 #: build/C/man2/poll.2:224
1889 msgid ""
1890 "Other than the difference in the precision of the I<timeout> argument, the "
1891 "following B<ppoll>()  call:"
1892 msgstr ""
1893
1894 #. type: Plain text
1895 #: build/C/man2/poll.2:227
1896 #, no-wrap
1897 msgid "    ready = ppoll(&fds, nfds, timeout_ts, &sigmask);\n"
1898 msgstr ""
1899
1900 #. type: Plain text
1901 #: build/C/man2/poll.2:236
1902 #, no-wrap
1903 msgid ""
1904 "    sigset_t origmask;\n"
1905 "    int timeout;\n"
1906 msgstr ""
1907
1908 #. type: Plain text
1909 #: build/C/man2/poll.2:242
1910 #, no-wrap
1911 msgid ""
1912 "    timeout = (timeout_ts == NULL) ? -1 :\n"
1913 "              (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000);\n"
1914 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
1915 "    ready = poll(&fds, nfds, timeout);\n"
1916 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
1917 msgstr ""
1918
1919 #. type: Plain text
1920 #: build/C/man2/poll.2:249
1921 msgid ""
1922 "See the description of B<pselect>(2)  for an explanation of why B<ppoll>()  "
1923 "is necessary."
1924 msgstr ""
1925
1926 #. type: Plain text
1927 #: build/C/man2/poll.2:261
1928 msgid ""
1929 "If the I<sigmask> argument is specified as NULL, then no signal mask "
1930 "manipulation is performed (and thus B<ppoll>()  differs from B<poll>()  only "
1931 "in the precision of the I<timeout> argument)."
1932 msgstr ""
1933
1934 #. type: Plain text
1935 #: build/C/man2/poll.2:268
1936 msgid ""
1937 "The I<timeout_ts> argument specifies an upper limit on the amount of time "
1938 "that B<ppoll>()  will block.  This argument is a pointer to a structure of "
1939 "the following form:"
1940 msgstr ""
1941
1942 #. type: Plain text
1943 #: build/C/man2/poll.2:275
1944 #, no-wrap
1945 msgid ""
1946 "struct timespec {\n"
1947 "    long    tv_sec;         /* seconds */\n"
1948 "    long    tv_nsec;        /* nanoseconds */\n"
1949 "};\n"
1950 msgstr ""
1951
1952 #. type: Plain text
1953 #: build/C/man2/poll.2:283
1954 msgid ""
1955 "If I<timeout_ts> is specified as NULL, then B<ppoll>()  can block "
1956 "indefinitely."
1957 msgstr ""
1958
1959 #. type: Plain text
1960 #: build/C/man2/poll.2:293
1961 msgid ""
1962 "On success, a positive number is returned; this is the number of structures "
1963 "which have nonzero I<revents> fields (in other words, those descriptors with "
1964 "events or errors reported).  A value of 0 indicates that the call timed out "
1965 "and no file descriptors were ready.  On error, -1 is returned, and I<errno> "
1966 "is set appropriately."
1967 msgstr ""
1968
1969 #. type: Plain text
1970 #: build/C/man2/poll.2:298
1971 msgid ""
1972 "The array given as argument was not contained in the calling program's "
1973 "address space."
1974 msgstr ""
1975
1976 #. type: Plain text
1977 #: build/C/man2/poll.2:302
1978 msgid "A signal occurred before any requested event; see B<signal>(7)."
1979 msgstr ""
1980
1981 #. type: Plain text
1982 #: build/C/man2/poll.2:309
1983 msgid "The I<nfds> value exceeds the B<RLIMIT_NOFILE> value."
1984 msgstr ""
1985
1986 #. type: Plain text
1987 #: build/C/man2/poll.2:312
1988 msgid "There was no space to allocate file descriptor tables."
1989 msgstr ""
1990
1991 #.  library call was introduced in libc 5.4.28
1992 #. type: Plain text
1993 #: build/C/man2/poll.2:322
1994 msgid ""
1995 "The B<poll>()  system call was introduced in Linux 2.1.23.  On older kernels "
1996 "that lack this system call, the glibc (and the old Linux libc)  B<poll>()  "
1997 "wrapper function provides emulation using B<select>(2)."
1998 msgstr ""
1999
2000 #. type: Plain text
2001 #: build/C/man2/poll.2:329
2002 msgid ""
2003 "The B<ppoll>()  system call was added to Linux in kernel 2.6.16.  The "
2004 "B<ppoll>()  library call was added in glibc 2.4."
2005 msgstr ""
2006
2007 #.  NetBSD 3.0 has a pollts() which is like Linux ppoll().
2008 #. type: Plain text
2009 #: build/C/man2/poll.2:335
2010 msgid "B<poll>()  conforms to POSIX.1-2001.  B<ppoll>()  is Linux-specific."
2011 msgstr ""
2012
2013 #. type: Plain text
2014 #: build/C/man2/poll.2:343
2015 msgid ""
2016 "Some implementations define the nonstandard constant B<INFTIM> with the "
2017 "value -1 for use as a I<timeout> for B<poll>().  This constant is not "
2018 "provided in glibc."
2019 msgstr ""
2020
2021 #. type: Plain text
2022 #: build/C/man2/poll.2:348
2023 msgid ""
2024 "For a discussion of what may happen if a file descriptor being monitored by "
2025 "B<poll>()  is closed in another thread, see B<select>(2)."
2026 msgstr ""
2027
2028 #. type: SS
2029 #: build/C/man2/poll.2:348
2030 #, no-wrap
2031 msgid "Linux notes"
2032 msgstr ""
2033
2034 #. type: Plain text
2035 #: build/C/man2/poll.2:362
2036 msgid ""
2037 "The Linux B<ppoll>()  system call modifies its I<timeout_ts> argument.  "
2038 "However, the glibc wrapper function hides this behavior by using a local "
2039 "variable for the timeout argument that is passed to the system call.  Thus, "
2040 "the glibc B<ppoll>()  function does not modify its I<timeout_ts> argument."
2041 msgstr ""
2042
2043 #. type: Plain text
2044 #: build/C/man2/poll.2:366
2045 msgid ""
2046 "See the discussion of spurious readiness notifications under the BUGS "
2047 "section of B<select>(2)."
2048 msgstr ""
2049
2050 #. type: Plain text
2051 #: build/C/man2/poll.2:371
2052 msgid "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<time>(7)"
2053 msgstr ""