1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Additions from Richard Gooch <rgooch@atnf.CSIRO.AU> and aeb, 971207
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Thu Dec 11 23:50:25 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.\"WORD: descriptor ǥץ
.\"
.TH POLL 2 "7 December 1997" "Linux 2.1.23" "Linux Programmer's Manual"
.SH ̾
poll \- ե롦ǥץˤ륤٥ȤԤ
.SH
.B #include <sys/poll.h>
.sp
.BI "int poll(struct pollfd *" ufds ", unsigned int " nfds ", int " timeout );
.SH
.B poll
.BR select
ƱŪѼǤ롣ϰʲηι¤Τ
.I ufds
˻ꤹ롣
.br
.nf
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */
short revents; /* returned events */
};
.fi
.I timeout
˥ߥäꤹ롣̵ͤ¡ॢ̵̣롣
¤Τ
.I fd
ˤϥץեΥե롦ǥ롣
¤Τ
.I events
Ǥϥѥǡץꥱ̣äƤ륤٥Ȥ
ӥåȥޥꤹ롣
.I revents
ǤϽϥѥǥͥˤäƼºݤ˵ä٥Ȥꤵ졢
ᤷ٥ȤΤɤ줫
.B POLLERR,
.B POLLHUP,
.BR POLLNVAL
Τɤ줫Ȥʤ롣(黰äĤΥӥåȤ
.I events
˻ꤷƤ̣ʤб֤ξ
.I revents
ꤵ롣)
ɤΥե롦ǥץˤᤷ٥ȤȯƤ餺
顼ⵯʤ硢ͥ
.I timeout
ߥäδ֡Υ٥ȤΤɤ줫ȯΤԤġ
ʲΥޥȤƻѲǽʥӥåȤ <sys/poll.h> Ƥ:
.br
.nf
#define POLLIN 0x0001 /* There is data to read */
#define POLLPRI 0x0002 /* There is urgent data to read */
#define POLLOUT 0x0004 /* Writing now will not block */
#define POLLERR 0x0008 /* Error condition */
#define POLLHUP 0x0010 /* Hung up */
#define POLLNVAL 0x0020 /* Invalid request: fd not open */
.fi
<asm/poll.h> ˤ
.BR POLLRDNORM ,
.BR POLLRDBAND ,
.BR POLLWRNORM ,
.B POLLWRBAND
.B POLLMSG
ʤɤͤƤ롣
.SH ֤
ο֤οϥʳ
.I revents
ǤŤΤοǤ롢(̤θȡΥǥץ
ˤϥ٥Ȥ顼𤬤롣)
顼ξ \-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B ENOMEM
ե롦ǥץơ֥ݤ뤿Υ꤬ʤ
.TP
.B EFAULT
ȤƻꤷƤӽФץΥɥ쥹֤
ޤޤƤʤ
.TP
.B EINTR
ᤵ줿٥ȤΤɤ줫˥ʥ뤬ȯ
.SH
XPG4-UNIX.
.SH ͭ
poll() ƥॳ Linux 2.1.23 Ƴ줿
poll() 饤֥ꡦ libc 5.4.28 Ƴ줿
(ϥͥ뤬 poll ƥॳݡȤƤʾ
select Ѥƥߥ졼ȤԤ)
.SH Ϣ
.BR select (2)
|