FreeBSD Bugzilla – Attachment 189131 Details for
Bug 224615
kevent: EVFILT_READ returns EV_EOF on named pipe when it should not
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to pipepoll.c demonstrating the issue
kqueue-new-reader-pollhup-pipepoll.patch (text/plain), 1.21 KB, created by
Jan Kokemüller
on 2017-12-27 14:16:53 UTC
(
hide
)
Description:
patch to pipepoll.c demonstrating the issue
Filename:
MIME Type:
Creator:
Jan Kokemüller
Created:
2017-12-27 14:16:53 UTC
Size:
1.21 KB
patch
obsolete
>diff --git a/tools/regression/poll/pipepoll.c b/tools/regression/poll/pipepoll.c >index 5ca064bf6bf3..43bf03659330 100644 >--- a/tools/regression/poll/pipepoll.c >+++ b/tools/regression/poll/pipepoll.c >@@ -1,5 +1,6 @@ > /* $FreeBSD$ */ > >+#include <sys/event.h> > #include <sys/poll.h> > #include <sys/socket.h> > #include <sys/stat.h> >@@ -202,6 +203,31 @@ child(int fd, int num) > if ((res = poll(&pfd, 1, 0)) < 0) > err(1, "poll"); > report(num++, "6b", POLLHUP, pfd.revents, res, 1); >+ >+ int kq = kqueue(); >+ >+ struct kevent kev; >+ EV_SET(&kev, fd2, EVFILT_READ, EV_ADD, 0, 0, 0); >+ if (kevent(kq, &kev, 1, NULL, 0, NULL) < 0) { >+ err(1, "kevent"); >+ } >+ >+ int n; >+ struct timespec ts = { 0, 0 }; >+ if ((n = kevent(kq, NULL, 0, &kev, 1, &ts)) < 0) { >+ err(1, "kevent"); >+ } >+ for (int i = 0; i < n; ++i) { >+ fprintf(stderr, "got event: %d\n", (int)kev.filter); >+ fprintf(stderr, " fd: %d\n", (int)kev.ident); >+ fprintf(stderr, " data: %d\n", (int)kev.data); >+ fprintf(stderr, " flags: %x\n", (unsigned)kev.flags); >+ fprintf(stderr, " fflags: %x\n", (unsigned)kev.fflags); >+ } >+ if (n == 0) { >+ fprintf(stderr, "got no events\n"); >+ } >+ > pfd.fd = fd; > if ((res = poll(&pfd, 1, 0)) < 0) > err(1, "poll");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224615
:
189130
| 189131 |
213659
|
213662