poll kernel module: overhaul with prints everywhere

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-07-11 02:00:01 +00:00
parent f9f6c557cc
commit 8cbf47265f
6 changed files with 90 additions and 22 deletions

View File

@@ -26,13 +26,14 @@ int main(int argc, char **argv) {
pfd.fd = fd;
pfd.events = POLLIN;
while (1) {
puts("loop");
puts("poll");
i = poll(&pfd, 1, -1);
if (i == -1) {
perror("poll");
assert(0);
}
revents = pfd.revents;
printf("revents = %d\n", revents);
if (revents & POLLIN) {
n = read(pfd.fd, buf, sizeof(buf));
printf("POLLIN n=%d buf=%.*s\n", n, n, buf);