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.
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"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man7/epoll.7:21
26 #: build/C/man7/epoll.7:21
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
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
40 msgid "Linux Programmer's Manual"
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
50 #: build/C/man7/epoll.7:24
51 msgid "epoll - I/O event notification facility"
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
61 #: build/C/man7/epoll.7:26 build/C/man2/epoll_ctl.2:25
62 msgid "B<#include E<lt>sys/epoll.hE<gt>>"
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
72 #: build/C/man7/epoll.7:40
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:"
82 #: build/C/man7/epoll.7:40 build/C/man7/epoll.7:49 build/C/man7/epoll.7:57
88 #: build/C/man7/epoll.7:49
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).)"
96 #: build/C/man7/epoll.7:57
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."
104 #: build/C/man7/epoll.7:61
106 "B<epoll_wait>(2) waits for I/O events, blocking the calling thread if no "
107 "events are currently available."
111 #: build/C/man7/epoll.7:61
113 msgid "Level-triggered and edge-triggered"
117 #: build/C/man7/epoll.7:70
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 "
126 #: build/C/man7/epoll.7:70
132 #: build/C/man7/epoll.7:76
134 "The file descriptor that represents the read side of a pipe (I<rfd>) is "
135 "registered on the B<epoll> instance."
139 #: build/C/man7/epoll.7:76
145 #: build/C/man7/epoll.7:78
146 msgid "A pipe writer writes 2 kB of data on the write side of the pipe."
150 #: build/C/man7/epoll.7:78
156 #: build/C/man7/epoll.7:84
158 "A call to B<epoll_wait>(2) is done that will return I<rfd> as a ready file "
163 #: build/C/man7/epoll.7:84
169 #: build/C/man7/epoll.7:87
170 msgid "The pipe reader reads 1 kB of data from I<rfd>."
174 #: build/C/man7/epoll.7:87
180 #: build/C/man7/epoll.7:91
181 msgid "A call to B<epoll_wait>(2) is done."
185 #: build/C/man7/epoll.7:126
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."
202 #: build/C/man7/epoll.7:136
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:"
211 #: build/C/man7/epoll.7:137
217 #: build/C/man7/epoll.7:140
218 msgid "with nonblocking file descriptors; and"
222 #: build/C/man7/epoll.7:140
228 #: build/C/man7/epoll.7:148
230 "by waiting for an event only after B<read>(2) or B<write>(2) return "
235 #: build/C/man7/epoll.7:159
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."
243 #: build/C/man7/epoll.7:176
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>."
254 #: build/C/man7/epoll.7:176
256 msgid "/proc interfaces"
259 #. Following was added in 2.6.28, but them removed in 2.6.29
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.
265 #: build/C/man7/epoll.7:184
267 "The following interfaces can be used to limit the amount of kernel memory "
272 #: build/C/man7/epoll.7:184
274 msgid "I</proc/sys/fs/epoll/max_user_watches> (since Linux 2.6.28)"
277 #. 2.6.29 (in 2.6.28, the default was 1/32 of lowmem)
279 #: build/C/man7/epoll.7:198
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."
290 #: build/C/man7/epoll.7:198
292 msgid "Example for suggested usage"
296 #: build/C/man7/epoll.7:227
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 "
311 #: build/C/man7/epoll.7:233
314 "#define MAX_EVENTS 10\n"
315 "struct epoll_event ev, events[MAX_EVENTS];\n"
316 "int listen_sock, conn_sock, nfds, epollfd;\n"
320 #: build/C/man7/epoll.7:236
323 "/* Set up listening socket, \\(aqlisten_sock\\(aq (socket(),\n"
324 " bind(), listen()) */\n"
328 #: build/C/man7/epoll.7:242
331 "epollfd = epoll_create(10);\n"
332 "if (epollfd == -1) {\n"
333 " perror(\"epoll_create\");\n"
334 " exit(EXIT_FAILURE);\n"
339 #: build/C/man7/epoll.7:249
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"
351 #: build/C/man7/epoll.7:256
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"
363 #: build/C/man7/epoll.7:278
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"
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"
379 " perror(\"epoll_ctl: conn_sock\");\n"
380 " exit(EXIT_FAILURE);\n"
383 " do_use_fd(events[n].data.fd);\n"
390 #: build/C/man7/epoll.7:297
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>."
400 #: build/C/man7/epoll.7:297
402 msgid "Questions and answers"
406 #: build/C/man7/epoll.7:298
412 #: build/C/man7/epoll.7:303
414 "What is the key used to distinguish the file descriptors registered in an "
419 #: build/C/man7/epoll.7:303
425 #: build/C/man7/epoll.7:309
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)."
433 #: build/C/man7/epoll.7:309
439 #: build/C/man7/epoll.7:314
441 "What happens if you register the same file descriptor on an B<epoll> "
446 #: build/C/man7/epoll.7:314
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.
462 #. See http://thread.gmane.org/gmane.linux.kernel/596462/
463 #. "epoll design problems with common fork/exec patterns"
467 #: build/C/man7/epoll.7:345
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> "
477 #: build/C/man7/epoll.7:345
483 #: build/C/man7/epoll.7:353
485 "Can two B<epoll> instances wait for the same file descriptor? If so, are "
486 "events reported to both B<epoll> file descriptors?"
490 #: build/C/man7/epoll.7:353
496 #: build/C/man7/epoll.7:357
498 "Yes, and events would be reported to both. However, careful programming may "
499 "be needed to do this correctly."
503 #: build/C/man7/epoll.7:357
509 #: build/C/man7/epoll.7:362
510 msgid "Is the B<epoll> file descriptor itself poll/epoll/selectable?"
514 #: build/C/man7/epoll.7:362
520 #: build/C/man7/epoll.7:369
522 "Yes. If an B<epoll> file descriptor has events waiting then it will "
523 "indicate as being readable."
527 #: build/C/man7/epoll.7:369
533 #: build/C/man7/epoll.7:374
535 "What happens if one attempts to put an B<epoll> file descriptor into its own "
536 "file descriptor set?"
540 #: build/C/man7/epoll.7:374
546 #: build/C/man7/epoll.7:385
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."
553 #: build/C/man7/epoll.7:385
559 #: build/C/man7/epoll.7:390
561 "Can I send an B<epoll> file descriptor over a UNIX domain socket to another "
566 #: build/C/man7/epoll.7:390
572 #: build/C/man7/epoll.7:396
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."
579 #: build/C/man7/epoll.7:396
585 #: build/C/man7/epoll.7:401
587 "Will closing a file descriptor cause it to be removed from all B<epoll> sets "
592 #: build/C/man7/epoll.7:401
598 #: build/C/man7/epoll.7:429
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 "
616 #: build/C/man7/epoll.7:429
622 #: build/C/man7/epoll.7:434
624 "If more than one event occurs between B<epoll_wait>(2) calls, are they "
625 "combined or reported separately?"
629 #: build/C/man7/epoll.7:434
635 #: build/C/man7/epoll.7:437
636 msgid "They will be combined."
640 #: build/C/man7/epoll.7:437
646 #: build/C/man7/epoll.7:441
648 "Does an operation on a file descriptor affect the already collected but not "
649 "yet reported events?"
653 #: build/C/man7/epoll.7:441
659 #: build/C/man7/epoll.7:447
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."
666 #: build/C/man7/epoll.7:447
672 #: build/C/man7/epoll.7:455
674 "Do I need to continuously read/write a file descriptor until B<EAGAIN> when "
675 "using the B<EPOLLET> flag (edge-triggered behavior) ?"
679 #: build/C/man7/epoll.7:455
685 #: build/C/man7/epoll.7:465
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."
694 #: build/C/man7/epoll.7:471
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>."
702 #: build/C/man7/epoll.7:487
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.)"
716 #: build/C/man7/epoll.7:487
718 msgid "Possible pitfalls and ways to avoid them"
722 #: build/C/man7/epoll.7:488
724 msgid "B<o Starvation (edge-triggered)>"
728 #: build/C/man7/epoll.7:496
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>.)"
736 #: build/C/man7/epoll.7:504
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."
746 #: build/C/man7/epoll.7:504
748 msgid "B<o If using an event cache...>"
752 #: build/C/man7/epoll.7:520
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."
764 #: build/C/man7/epoll.7:531
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."
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
780 #. Its interface should be finalized in Linux kernel 2.5.66.
782 #: build/C/man7/epoll.7:537
784 "The B<epoll> API was introduced in Linux kernel 2.5.44. Support was added "
785 "to glibc in version 2.3.2."
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
791 msgid "CONFORMING TO"
795 #: build/C/man7/epoll.7:546
797 "The B<epoll> API is Linux-specific. Some other systems provide similar "
798 "mechanisms, for example, FreeBSD has I<kqueue>, and Solaris has "
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
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)"
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
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
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/."
828 #: build/C/man2/epoll_create.2:24
834 #: build/C/man2/epoll_create.2:24 build/C/man2/epoll_ctl.2:20
840 #: build/C/man2/epoll_create.2:27
841 msgid "epoll_create, epoll_create1 - open an epoll file descriptor"
845 #: build/C/man2/epoll_create.2:30 build/C/man2/epoll_wait.2:28
847 msgid "B<#include E<lt>sys/epoll.hE<gt>>\n"
851 #: build/C/man2/epoll_create.2:33
854 "B<int epoll_create(int >I<size>B<);>\n"
855 "B<int epoll_create1(int >I<flags>B<);>\n"
859 #: build/C/man2/epoll_create.2:42
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."
866 #: build/C/man2/epoll_create.2:55
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."
877 #: build/C/man2/epoll_create.2:55
879 msgid "epoll_create1()"
883 #: build/C/man2/epoll_create.2:67
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 "
892 #: build/C/man2/epoll_create.2:67
894 msgid "B<EPOLL_CLOEXEC>"
898 #: build/C/man2/epoll_create.2:77
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 "
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
912 #: build/C/man2/epoll_create.2:84
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."
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
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
931 #: build/C/man2/epoll_create.2:89
932 msgid "I<size> is not positive."
936 #: build/C/man2/epoll_create.2:94
937 msgid "(B<epoll_create1>()) Invalid value specified in I<flags>."
941 #: build/C/man2/epoll_create.2:94
947 #: build/C/man2/epoll_create.2:102
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."
955 #: build/C/man2/epoll_create.2:102
961 #: build/C/man2/epoll_create.2:105
962 msgid "The system limit on the total number of open files has been reached."
966 #: build/C/man2/epoll_create.2:105 build/C/man2/epoll_ctl.2:204 build/C/man2/poll.2:309
972 #: build/C/man2/epoll_create.2:108
973 msgid "There was insufficient memory to create the kernel object."
977 #: build/C/man2/epoll_create.2:112
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."
983 #. To be precise: kernel 2.5.44.
984 #. The interface should be finalized by Linux kernel 2.5.66.
986 #: build/C/man2/epoll_create.2:118
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."
993 #: build/C/man2/epoll_create.2:121
994 msgid "B<epoll_create>() is Linux-specific."
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
1004 #: build/C/man2/epoll_create.2:144
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."
1019 #: build/C/man2/epoll_create.2:149
1020 msgid "B<close>(2), B<epoll_ctl>(2), B<epoll_wait>(2), B<epoll>(7)"
1024 #: build/C/man2/epoll_ctl.2:20
1030 #: build/C/man2/epoll_ctl.2:23
1031 msgid "epoll_ctl - control interface for an epoll descriptor"
1035 #: build/C/man2/epoll_ctl.2:28
1037 "B<int epoll_ctl(int >I<epfd>B<, int >I<op>B<, int >I<fd>B<, struct "
1038 "epoll_event *>I<event>B<);>"
1042 #: build/C/man2/epoll_ctl.2:38
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>."
1050 #: build/C/man2/epoll_ctl.2:42
1051 msgid "Valid values for the I<op> argument are :"
1055 #: build/C/man2/epoll_ctl.2:42
1057 msgid "B<EPOLL_CTL_ADD>"
1061 #: build/C/man2/epoll_ctl.2:54
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>."
1069 #: build/C/man2/epoll_ctl.2:54
1071 msgid "B<EPOLL_CTL_MOD>"
1075 #: build/C/man2/epoll_ctl.2:60
1076 msgid "Change the event I<event> associated with the target file descriptor I<fd>."
1080 #: build/C/man2/epoll_ctl.2:60
1082 msgid "B<EPOLL_CTL_DEL>"
1086 #: build/C/man2/epoll_ctl.2:71
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)."
1094 #: build/C/man2/epoll_ctl.2:79
1096 "The I<event> argument describes the object linked to the file descriptor "
1097 "I<fd>. The I<struct epoll_event> is defined as :"
1101 #: build/C/man2/epoll_ctl.2:88
1104 "typedef union epoll_data {\n"
1113 #: build/C/man2/epoll_ctl.2:93
1116 "struct epoll_event {\n"
1117 " uint32_t events; /* Epoll events */\n"
1118 " epoll_data_t data; /* User data variable */\n"
1123 #: build/C/man2/epoll_ctl.2:100
1125 "The I<events> member is a bit set composed using the following available "
1130 #: build/C/man2/epoll_ctl.2:100
1136 #: build/C/man2/epoll_ctl.2:105
1137 msgid "The associated file is available for B<read>(2) operations."
1141 #: build/C/man2/epoll_ctl.2:105
1147 #: build/C/man2/epoll_ctl.2:110
1148 msgid "The associated file is available for B<write>(2) operations."
1152 #: build/C/man2/epoll_ctl.2:110
1154 msgid "B<EPOLLRDHUP> (since Linux 2.6.17)"
1158 #: build/C/man2/epoll_ctl.2:116
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.)"
1166 #: build/C/man2/epoll_ctl.2:116
1172 #: build/C/man2/epoll_ctl.2:121
1173 msgid "There is urgent data available for B<read>(2) operations."
1177 #: build/C/man2/epoll_ctl.2:121
1183 #: build/C/man2/epoll_ctl.2:127
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>."
1191 #: build/C/man2/epoll_ctl.2:127
1197 #: build/C/man2/epoll_ctl.2:133
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>."
1204 #: build/C/man2/epoll_ctl.2:133
1210 #: build/C/man2/epoll_ctl.2:143
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 "
1219 #: build/C/man2/epoll_ctl.2:143
1221 msgid "B<EPOLLONESHOT> (since Linux 2.6.2)"
1225 #: build/C/man2/epoll_ctl.2:157
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."
1235 #: build/C/man2/epoll_ctl.2:166
1237 "When successful, B<epoll_ctl>() returns zero. When an error occurs, "
1238 "B<epoll_ctl>() returns -1 and I<errno> is set appropriately."
1242 #: build/C/man2/epoll_ctl.2:167 build/C/man2/epoll_wait.2:153
1248 #: build/C/man2/epoll_ctl.2:173
1249 msgid "I<epfd> or I<fd> is not a valid file descriptor."
1253 #: build/C/man2/epoll_ctl.2:173
1259 #: build/C/man2/epoll_ctl.2:181
1261 "I<op> was B<EPOLL_CTL_ADD>, and the supplied file descriptor I<fd> is "
1262 "already registered with this epoll instance."
1266 #: build/C/man2/epoll_ctl.2:194
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."
1273 #: build/C/man2/epoll_ctl.2:194
1279 #: build/C/man2/epoll_ctl.2:204
1281 "I<op> was B<EPOLL_CTL_MOD> or B<EPOLL_CTL_DEL>, and I<fd> is not registered "
1282 "with this epoll instance."
1286 #: build/C/man2/epoll_ctl.2:209
1288 "There was insufficient memory to handle the requested I<op> control "
1293 #: build/C/man2/epoll_ctl.2:209
1299 #: build/C/man2/epoll_ctl.2:219
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."
1307 #: build/C/man2/epoll_ctl.2:219
1313 #: build/C/man2/epoll_ctl.2:225
1314 msgid "The target file I<fd> does not support B<epoll>."
1317 #. To be precise: kernel 2.5.44.
1318 #. The interface should be finalized by Linux kernel 2.5.66.
1320 #: build/C/man2/epoll_ctl.2:230
1321 msgid "B<epoll_ctl>() was added to the kernel in version 2.6."
1325 #: build/C/man2/epoll_ctl.2:234
1327 "B<epoll_ctl>() is Linux-specific. Library support is provided in glibc "
1328 "starting with version 2.3.2."
1332 #: build/C/man2/epoll_ctl.2:239
1334 "The B<epoll> interface supports all file descriptors that support "
1339 #: build/C/man2/epoll_ctl.2:239 build/C/man2/epoll_wait.2:207 build/C/man2/poll.2:362
1345 #: build/C/man2/epoll_ctl.2:253
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>."
1355 #: build/C/man2/epoll_ctl.2:258
1356 msgid "B<epoll_create>(2), B<epoll_wait>(2), B<poll>(2), B<epoll>(7)"
1360 #: build/C/man2/epoll_wait.2:22
1366 #: build/C/man2/epoll_wait.2:22
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"
1377 #: build/C/man2/epoll_wait.2:34
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"
1388 #: build/C/man2/epoll_wait.2:52
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."
1398 #: build/C/man2/epoll_wait.2:70
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."
1410 #: build/C/man2/epoll_wait.2:74
1411 msgid "The I<struct epoll_event> is defined as :"
1415 #: build/C/man2/epoll_wait.2:83
1418 "typedef union epoll_data {\n"
1427 #: build/C/man2/epoll_wait.2:88
1430 "struct epoll_event {\n"
1431 " uint32_t events; /* Epoll events */\n"
1432 " epoll_data_t data; /* User data variable */\n"
1437 #: build/C/man2/epoll_wait.2:99
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."
1445 #: build/C/man2/epoll_wait.2:99
1447 msgid "epoll_pwait()"
1451 #: build/C/man2/epoll_wait.2:113
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."
1460 #: build/C/man2/epoll_wait.2:117
1461 msgid "The following B<epoll_pwait>() call:"
1465 #: build/C/man2/epoll_wait.2:120
1467 msgid " ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask);\n"
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:"
1476 #: build/C/man2/epoll_wait.2:128
1478 msgid " sigset_t origmask;\n"
1482 #: build/C/man2/epoll_wait.2:132
1485 " sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
1486 " ready = epoll_wait(epfd, &events, maxevents, timeout);\n"
1487 " sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
1491 #: build/C/man2/epoll_wait.2:140
1493 "The I<sigmask> argument may be specified as NULL, in which case "
1494 "B<epoll_pwait>() is equivalent to B<epoll_wait>()."
1498 #: build/C/man2/epoll_wait.2:152
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."
1507 #: build/C/man2/epoll_wait.2:157
1508 msgid "I<epfd> is not a valid file descriptor."
1512 #: build/C/man2/epoll_wait.2:157 build/C/man2/poll.2:294
1518 #: build/C/man2/epoll_wait.2:162
1520 "The memory area pointed to by I<events> is not accessible with write "
1525 #: build/C/man2/epoll_wait.2:162 build/C/man2/poll.2:298
1531 #: build/C/man2/epoll_wait.2:169
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)."
1538 #: build/C/man2/epoll_wait.2:177
1540 "I<epfd> is not an B<epoll> file descriptor, or I<maxevents> is less than or "
1544 #. To be precise: kernel 2.5.44.
1545 #. The interface should be finalized by Linux kernel 2.5.66.
1547 #: build/C/man2/epoll_wait.2:183
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."
1554 #: build/C/man2/epoll_wait.2:187
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."
1561 #: build/C/man2/epoll_wait.2:190
1562 msgid "B<epoll_wait>() is Linux-specific."
1566 #: build/C/man2/epoll_wait.2:200
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."
1575 #: build/C/man2/epoll_wait.2:207
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, "
1583 #: build/C/man2/epoll_wait.2:219
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."
1593 #: build/C/man2/epoll_wait.2:223
1594 msgid "B<epoll_create>(2), B<epoll_ctl>(2), B<epoll>(7)"
1598 #: build/C/man2/poll.2:31
1604 #: build/C/man2/poll.2:31
1610 #: build/C/man2/poll.2:34
1611 msgid "poll, ppoll - wait for some event on a file descriptor"
1615 #: build/C/man2/poll.2:37
1617 msgid "B<#include E<lt>poll.hE<gt>>\n"
1621 #: build/C/man2/poll.2:39
1624 "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int "
1625 ">I<timeout>B<);>\n"
1629 #: build/C/man2/poll.2:42
1632 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
1633 "B<#include E<lt>poll.hE<gt>>\n"
1637 #: build/C/man2/poll.2:45
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"
1646 #: build/C/man2/poll.2:52
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."
1653 #: build/C/man2/poll.2:56
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:"
1660 #: build/C/man2/poll.2:64
1664 " int fd; /* file descriptor */\n"
1665 " short events; /* requested events */\n"
1666 " short revents; /* returned events */\n"
1671 #: build/C/man2/poll.2:71
1673 "The caller should specify the number of items in the I<fds> array in "
1678 #: build/C/man2/poll.2:86
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> "
1688 #: build/C/man2/poll.2:98
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."
1697 #: build/C/man2/poll.2:117
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.)"
1708 #: build/C/man2/poll.2:122
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."
1715 #: build/C/man2/poll.2:139
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."
1727 #: build/C/man2/poll.2:145
1729 "The bits that may be set/returned in I<events> and I<revents> are defined in "
1730 "I<E<lt>poll.hE<gt>>:"
1734 #: build/C/man2/poll.2:146
1740 #: build/C/man2/poll.2:149
1741 msgid "There is data to read."
1745 #: build/C/man2/poll.2:149
1751 #: build/C/man2/poll.2:153
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)."
1758 #: build/C/man2/poll.2:153
1764 #: build/C/man2/poll.2:156
1765 msgid "Writing now will not block."
1769 #: build/C/man2/poll.2:156
1771 msgid "B<POLLRDHUP> (since Linux 2.6.17)"
1775 #: build/C/man2/poll.2:167
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."
1783 #: build/C/man2/poll.2:167
1789 #: build/C/man2/poll.2:170
1790 msgid "Error condition (output only)."
1794 #: build/C/man2/poll.2:170
1800 #: build/C/man2/poll.2:173
1801 msgid "Hang up (output only)."
1805 #: build/C/man2/poll.2:173
1811 #: build/C/man2/poll.2:178
1812 msgid "Invalid request: I<fd> not open (output only)."
1816 #: build/C/man2/poll.2:184
1818 "When compiling with B<_XOPEN_SOURCE> defined, one also has the following, "
1819 "which convey no further information beyond the bits listed above:"
1823 #: build/C/man2/poll.2:185
1825 msgid "B<POLLRDNORM>"
1829 #: build/C/man2/poll.2:189
1830 msgid "Equivalent to B<POLLIN>."
1834 #: build/C/man2/poll.2:189
1836 msgid "B<POLLRDBAND>"
1839 #. POLLRDBAND is used in the DECnet protocol.
1841 #: build/C/man2/poll.2:193
1842 msgid "Priority band data can be read (generally unused on Linux)."
1846 #: build/C/man2/poll.2:193
1848 msgid "B<POLLWRNORM>"
1852 #: build/C/man2/poll.2:197
1853 msgid "Equivalent to B<POLLOUT>."
1857 #: build/C/man2/poll.2:197
1859 msgid "B<POLLWRBAND>"
1863 #: build/C/man2/poll.2:200
1864 msgid "Priority data may be written."
1868 #: build/C/man2/poll.2:204
1869 msgid "Linux also knows about, but does not use B<POLLMSG>."
1873 #: build/C/man2/poll.2:204
1879 #: build/C/man2/poll.2:218
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."
1888 #: build/C/man2/poll.2:224
1890 "Other than the difference in the precision of the I<timeout> argument, the "
1891 "following B<ppoll>() call:"
1895 #: build/C/man2/poll.2:227
1897 msgid " ready = ppoll(&fds, nfds, timeout_ts, &sigmask);\n"
1901 #: build/C/man2/poll.2:236
1904 " sigset_t origmask;\n"
1909 #: build/C/man2/poll.2:242
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"
1920 #: build/C/man2/poll.2:249
1922 "See the description of B<pselect>(2) for an explanation of why B<ppoll>() "
1927 #: build/C/man2/poll.2:261
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)."
1935 #: build/C/man2/poll.2:268
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:"
1943 #: build/C/man2/poll.2:275
1946 "struct timespec {\n"
1947 " long tv_sec; /* seconds */\n"
1948 " long tv_nsec; /* nanoseconds */\n"
1953 #: build/C/man2/poll.2:283
1955 "If I<timeout_ts> is specified as NULL, then B<ppoll>() can block "
1960 #: build/C/man2/poll.2:293
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."
1970 #: build/C/man2/poll.2:298
1972 "The array given as argument was not contained in the calling program's "
1977 #: build/C/man2/poll.2:302
1978 msgid "A signal occurred before any requested event; see B<signal>(7)."
1982 #: build/C/man2/poll.2:309
1983 msgid "The I<nfds> value exceeds the B<RLIMIT_NOFILE> value."
1987 #: build/C/man2/poll.2:312
1988 msgid "There was no space to allocate file descriptor tables."
1991 #. library call was introduced in libc 5.4.28
1993 #: build/C/man2/poll.2:322
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)."
2001 #: build/C/man2/poll.2:329
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."
2007 #. NetBSD 3.0 has a pollts() which is like Linux ppoll().
2009 #: build/C/man2/poll.2:335
2010 msgid "B<poll>() conforms to POSIX.1-2001. B<ppoll>() is Linux-specific."
2014 #: build/C/man2/poll.2:343
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."
2022 #: build/C/man2/poll.2:348
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)."
2029 #: build/C/man2/poll.2:348
2035 #: build/C/man2/poll.2:362
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."
2044 #: build/C/man2/poll.2:366
2046 "See the discussion of spurious readiness notifications under the BUGS "
2047 "section of B<select>(2)."
2051 #: build/C/man2/poll.2:371
2052 msgid "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<time>(7)"