Debian Codegraph @

po/ko/man2/poll.2.po

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