* the term() function.
* - clo() should be used to do indicate the poller that fd will be closed.
* - poll() calls the poller, expiring at <exp>
+ * - flags indicate what the poller supports (HAP_POLL_F_*)
*/
+
+#define HAP_POLL_F_RDHUP 0x00000001 /* the poller notifies of HUP with reads */
+
struct poller {
void *private; /* any private data for the poller */
void REGPRM1 (*clo)(const int fd); /* mark <fd> as closed */
int REGPRM1 (*test)(struct poller *p); /* pre-init check of the poller */
int REGPRM1 (*fork)(struct poller *p); /* post-fork re-opening */
const char *name; /* poller name */
+ unsigned int flags; /* HAP_POLL_F_* */
int pref; /* try pollers with higher preference first */
};
}
/* always remap RDHUP to HUP as they're used similarly */
- if (e & EPOLLRDHUP)
+ if (e & EPOLLRDHUP) {
+ cur_poller.flags |= HAP_POLL_F_RDHUP;
n |= FD_POLL_HUP;
+ }
fdtab[fd].ev |= n;
if (n & (FD_POLL_IN | FD_POLL_HUP | FD_POLL_ERR))
p->name = "epoll";
p->pref = 300;
+ p->flags = 0;
p->private = NULL;
p->clo = __fd_clo;