mirror of https://github.com/mkerrisk/man-pages
ffixes
This commit is contained in:
parent
cb1de8d77d
commit
3bc917f6ca
32
man7/epoll.7
32
man7/epoll.7
|
@ -121,9 +121,9 @@ as an edge-triggered
|
||||||
.RB ( EPOLLET )
|
.RB ( EPOLLET )
|
||||||
interface is as follows:
|
interface is as follows:
|
||||||
.RS
|
.RS
|
||||||
.TP
|
.TP 4
|
||||||
.B i
|
.B i
|
||||||
with non-blocking file descriptors
|
with non-blocking file descriptors; and
|
||||||
.TP
|
.TP
|
||||||
.B ii
|
.B ii
|
||||||
by waiting for an event only after
|
by waiting for an event only after
|
||||||
|
@ -188,6 +188,7 @@ or
|
||||||
.BR write (2)
|
.BR write (2)
|
||||||
from where it stopped before.
|
from where it stopped before.
|
||||||
|
|
||||||
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
struct epoll_event ev, *events;
|
struct epoll_event ev, *events;
|
||||||
|
|
||||||
|
@ -205,8 +206,10 @@ for (;;) {
|
||||||
setnonblocking(client);
|
setnonblocking(client);
|
||||||
ev.events = EPOLLIN | EPOLLET;
|
ev.events = EPOLLIN | EPOLLET;
|
||||||
ev.data.fd = client;
|
ev.data.fd = client;
|
||||||
if (epoll_ctl(kdpfd, EPOLL_CTL_ADD, client, &ev) < 0) {
|
if (epoll_ctl(kdpfd, EPOLL_CTL_ADD, client, &ev)
|
||||||
fprintf(stderr, "epoll set insertion error: fd=%d\\n",
|
== \-1) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"epoll set insertion error: fd=%d\\n",
|
||||||
client);
|
client);
|
||||||
return \-1;
|
return \-1;
|
||||||
}
|
}
|
||||||
|
@ -216,9 +219,12 @@ for (;;) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fi
|
.fi
|
||||||
|
.in
|
||||||
|
|
||||||
When used as an edge-triggered interface, for performance reasons, it is
|
When used as an edge-triggered interface, for performance reasons, it is
|
||||||
possible to add the file descriptor inside the epoll interface
|
possible to add the file descriptor inside the
|
||||||
|
.B epoll
|
||||||
|
interface
|
||||||
.RB ( EPOLL_CTL_ADD )
|
.RB ( EPOLL_CTL_ADD )
|
||||||
once by specifying
|
once by specifying
|
||||||
.RB ( EPOLLIN | EPOLLOUT ).
|
.RB ( EPOLLIN | EPOLLOUT ).
|
||||||
|
@ -234,7 +240,9 @@ with
|
||||||
.SS Questions and Answers
|
.SS Questions and Answers
|
||||||
.TP 4
|
.TP 4
|
||||||
.B Q0
|
.B Q0
|
||||||
What is the key used to distinguish the file descriptors in an epoll set?
|
What is the key used to distinguish the file descriptors in an
|
||||||
|
.B epoll
|
||||||
|
set?
|
||||||
.TP
|
.TP
|
||||||
.B A0
|
.B A0
|
||||||
The key is the combination of the file descriptor number and
|
The key is the combination of the file descriptor number and
|
||||||
|
@ -243,7 +251,9 @@ the open file description
|
||||||
the kernel's internal representation of an open file).
|
the kernel's internal representation of an open file).
|
||||||
.TP
|
.TP
|
||||||
.B Q1
|
.B Q1
|
||||||
What happens if you add the same file descriptor to an epoll set twice?
|
What happens if you add the same file descriptor to an
|
||||||
|
.B epoll
|
||||||
|
set twice?
|
||||||
.TP
|
.TP
|
||||||
.B A1
|
.B A1
|
||||||
You will probably get
|
You will probably get
|
||||||
|
@ -312,7 +322,9 @@ call will fail
|
||||||
.RB ( EINVAL ).
|
.RB ( EINVAL ).
|
||||||
However, you can add an
|
However, you can add an
|
||||||
.B epoll
|
.B epoll
|
||||||
file descriptor inside another epoll file descriptor set.
|
file descriptor inside another
|
||||||
|
.B epoll
|
||||||
|
file descriptor set.
|
||||||
.TP
|
.TP
|
||||||
.B Q5
|
.B Q5
|
||||||
Can I send the
|
Can I send the
|
||||||
|
@ -461,7 +473,9 @@ The
|
||||||
API was introduced in Linux kernel 2.5.44.
|
API was introduced in Linux kernel 2.5.44.
|
||||||
Its interface should be finalized in Linux kernel 2.5.66.
|
Its interface should be finalized in Linux kernel 2.5.66.
|
||||||
.SH CONFORMING TO
|
.SH CONFORMING TO
|
||||||
The epoll API is Linux-specific.
|
The
|
||||||
|
.B epoll
|
||||||
|
API is Linux-specific.
|
||||||
Some other systems provide similar
|
Some other systems provide similar
|
||||||
mechanisms, for example, FreeBSD has
|
mechanisms, for example, FreeBSD has
|
||||||
.IR kqueue ,
|
.IR kqueue ,
|
||||||
|
|
Loading…
Reference in New Issue