On 27/02/2023 18:26, Pádraig Brady wrote:
Attached are the current patches I have for this functionality.
I'll do a bit more testing and hope to push them early tomorrow.

I'm squashing in the following to handle illumos and macOS.
Also it decouples the code from the pollfd structure layout,
by using C99 designated initializers.

cheers,
Pádraig

diff --git a/src/iopoll.c b/src/iopoll.c
index 916241f89..ceb1b43ad 100644
--- a/src/iopoll.c
+++ b/src/iopoll.c
@@ -49,7 +49,10 @@
 extern int
 iopoll (int fdin, int fdout)
 {
-  struct pollfd pfds[2] = {{fdin, POLLIN, 0}, {fdout, 0, 0}};
+  struct pollfd pfds[2] = {  /* POLLRDBAND needed for illumos, macOS.  */
+    { .fd = fdin,  .events = POLLIN | POLLRDBAND, .revents = 0 },
+    { .fd = fdout, .events = POLLRDBAND, .revents = 0 },
+  };

   while (poll (pfds, 2, -1) > 0 || errno == EINTR)
     {


Reply via email to