File: poll.2

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (151 lines) | stat: -rw-r--r-- 4,832 bytes parent folder | download
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.\" 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>
.\" Updated & Modified Sat May 22 15:57:57 JST 2004
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated & Modified Mon Jan  3 02:42:03 JST 2005 by Yuichi SATO
.\"
.\"WORD:	descriptor		ǥץ
.\"
.TH POLL 2 1997-12-07 "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
XPG4.2 Υ򥳥ѥ뤹ȤϡʲΥӥåȤ롣
.br
.nf
#ifdef _XOPEN_SOURCE
    #define POLLRDNORM  0x0040    /* Normal data may be read */
    #define POLLRDBAND  0x0080    /* Priority data may be read */
    #define POLLWRNORM  0x0100    /* Writing now will not block */
    #define POLLWRBAND  0x0200    /* Priority data may be written */
#endif
.fi
Linux ǤϹ˰ʲ롣
.br
.nf
#ifdef _GNU_SOURCE
    #define POLLMSG     0x0400
#endif
.fi
.SH ֤
ο֤ο 0 ʳ
.I revents
ǤŤΤοǤ (̤θ򤹤ȡΥǥץ
ˤϥ٥Ȥ顼𤬤)
顼ξ \-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B EBADF
Τɤ줫ʥե롦ǥץޤޤƤ롣
.TP
.B EFAULT
Ȥƻꤷ󤬡ƤӽФץΥɥ쥹֤
ޤޤƤʤ
.TP
.B EINTR
׵ᤵ줿٥ȤΤɤ줫˥ʥ뤬ȯ
.TP
.B EINVAL
.I nfds
ͤ  RLIMIT_NOFILE Ķ
.TP
.B ENOMEM
ե롦ǥץơ֥ݤ뤿Υ꤬ʤ
.SH Х
.BR select (2)
Ρ֥ХפΥ򻲾Ȥ뤳ȡ
.SH 
XPG4-UNIX.
.SH ͭ
poll() ƥॳ Linux 2.1.23 Ƴ줿
poll() 饤֥ꡦ libc 5.4.28 Ƴ줿
(ϥͥ뤬 poll ƥॳ򥵥ݡȤƤʤ
select Ѥƥߥ졼ȤԤ)
.SH Ϣ
.BR select (2),
.BR select_tut (2)