summaryrefslogtreecommitdiffstats
path: root/templates/man2/poll.2.pot
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/man2/poll.2.pot123
1 files changed, 112 insertions, 11 deletions
diff --git a/templates/man2/poll.2.pot b/templates/man2/poll.2.pot
index c04b9bac..acdcb5fa 100644
--- a/templates/man2/poll.2.pot
+++ b/templates/man2/poll.2.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2024-03-01 17:04+0100\n"
+"POT-Creation-Date: 2024-06-01 06:09+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -24,15 +24,15 @@ msgid "poll"
msgstr ""
#. type: TH
-#: archlinux fedora-40 fedora-rawhide mageia-cauldron
+#: archlinux debian-unstable opensuse-tumbleweed
#, no-wrap
-msgid "2023-10-31"
+msgid "2024-05-02"
msgstr ""
#. type: TH
-#: archlinux fedora-40 fedora-rawhide mageia-cauldron
+#: archlinux debian-unstable
#, no-wrap
-msgid "Linux man-pages 6.06"
+msgid "Linux man-pages 6.8"
msgstr ""
#. type: SH
@@ -927,8 +927,7 @@ msgid "Program source"
msgstr ""
#. type: Plain text
-#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
-#: opensuse-tumbleweed
+#: archlinux debian-unstable opensuse-tumbleweed
#, no-wrap
msgid ""
"/* poll_input.c\n"
@@ -939,6 +938,7 @@ msgid ""
"#include E<lt>poll.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
+"#include E<lt>sys/types.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
"\\&\n"
"#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
@@ -1280,15 +1280,110 @@ msgid ""
msgstr ""
#. type: TH
-#: debian-unstable opensuse-tumbleweed
+#: fedora-40 fedora-rawhide mageia-cauldron
#, no-wrap
-msgid "2023-07-08"
+msgid "2023-10-31"
msgstr ""
#. type: TH
-#: debian-unstable opensuse-tumbleweed
+#: fedora-40 mageia-cauldron
#, no-wrap
-msgid "Linux man-pages 6.05.01"
+msgid "Linux man-pages 6.06"
+msgstr ""
+
+#. type: Plain text
+#: fedora-40 fedora-rawhide mageia-cauldron
+#, no-wrap
+msgid ""
+"/* poll_input.c\n"
+"\\&\n"
+" Licensed under GNU General Public License v2 or later.\n"
+"*/\n"
+"#include E<lt>fcntl.hE<gt>\n"
+"#include E<lt>poll.hE<gt>\n"
+"#include E<lt>stdio.hE<gt>\n"
+"#include E<lt>stdlib.hE<gt>\n"
+"#include E<lt>unistd.hE<gt>\n"
+"\\&\n"
+"#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
+" } while (0)\n"
+"\\&\n"
+"int\n"
+"main(int argc, char *argv[])\n"
+"{\n"
+" int ready;\n"
+" char buf[10];\n"
+" nfds_t num_open_fds, nfds;\n"
+" ssize_t s;\n"
+" struct pollfd *pfds;\n"
+"\\&\n"
+" if (argc E<lt> 2) {\n"
+" fprintf(stderr, \"Usage: %s file...\\en\", argv[0]);\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+"\\&\n"
+" num_open_fds = nfds = argc - 1;\n"
+" pfds = calloc(nfds, sizeof(struct pollfd));\n"
+" if (pfds == NULL)\n"
+" errExit(\"malloc\");\n"
+"\\&\n"
+" /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
+"\\&\n"
+" for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
+" pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
+" if (pfds[j].fd == -1)\n"
+" errExit(\"open\");\n"
+"\\&\n"
+" printf(\"Opened \\e\"%s\\e\" on fd %d\\en\", argv[j + 1], pfds[j].fd);\n"
+"\\&\n"
+" pfds[j].events = POLLIN;\n"
+" }\n"
+"\\&\n"
+" /* Keep calling poll() as long as at least one file descriptor is\n"
+" open. */\n"
+"\\&\n"
+" while (num_open_fds E<gt> 0) {\n"
+" printf(\"About to poll()\\en\");\n"
+" ready = poll(pfds, nfds, -1);\n"
+" if (ready == -1)\n"
+" errExit(\"poll\");\n"
+"\\&\n"
+" printf(\"Ready: %d\\en\", ready);\n"
+"\\&\n"
+" /* Deal with array returned by poll(). */\n"
+"\\&\n"
+" for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
+" if (pfds[j].revents != 0) {\n"
+" printf(\" fd=%d; events: %s%s%s\\en\", pfds[j].fd,\n"
+" (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
+" (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
+" (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
+"\\&\n"
+" if (pfds[j].revents & POLLIN) {\n"
+" s = read(pfds[j].fd, buf, sizeof(buf));\n"
+" if (s == -1)\n"
+" errExit(\"read\");\n"
+" printf(\" read %zd bytes: %.*s\\en\",\n"
+" s, (int) s, buf);\n"
+" } else { /* POLLERR | POLLHUP */\n"
+" printf(\" closing fd %d\\en\", pfds[j].fd);\n"
+" if (close(pfds[j].fd) == -1)\n"
+" errExit(\"close\");\n"
+" num_open_fds--;\n"
+" }\n"
+" }\n"
+" }\n"
+" }\n"
+"\\&\n"
+" printf(\"All file descriptors closed; bye\\en\");\n"
+" exit(EXIT_SUCCESS);\n"
+"}\n"
+msgstr ""
+
+#. type: TH
+#: fedora-rawhide
+#, no-wrap
+msgid "Linux man-pages 6.7"
msgstr ""
#. type: TH
@@ -1302,3 +1397,9 @@ msgstr ""
#, no-wrap
msgid "Linux man-pages 6.04"
msgstr ""
+
+#. type: TH
+#: opensuse-tumbleweed
+#, no-wrap
+msgid "Linux man-pages (unreleased)"
+msgstr ""