MINOR: pollers: add a new flag to indicate pollers reporting ERR & HUP

In practice it's all pollers except select(). It turns out that we're
keeping some legacy code only for select and enforcing it on all
pollers, let's offer the pollers the ability to declare that they
do not need that.
diff --git a/include/types/fd.h b/include/types/fd.h
index 580e180..dae1c90 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -162,7 +162,8 @@
  *  - flags indicate what the poller supports (HAP_POLL_F_*)
  */
 
-#define HAP_POLL_F_RDHUP 0x00000001                          /* the poller notifies of HUP with reads */
+#define HAP_POLL_F_RDHUP        0x00000001                   /* the poller notifies of HUP with reads */
+#define HAP_POLL_F_ERRHUP       0x00000002                   /* the poller reports ERR and HUP */
 
 struct poller {
 	void   *private;                                     /* any private data for the poller */
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index dc156e5..8b2c2ee 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -360,7 +360,7 @@
 
 	p->name = "epoll";
 	p->pref = 300;
-	p->flags = 0;
+	p->flags = HAP_POLL_F_ERRHUP; // note: RDHUP might be dynamically added
 	p->private = NULL;
 
 	p->clo  = __fd_clo;
diff --git a/src/ev_evports.c b/src/ev_evports.c
index bde617d..2aea201 100644
--- a/src/ev_evports.c
+++ b/src/ev_evports.c
@@ -422,7 +422,7 @@
 
 	p->name = "evports";
 	p->pref = 300;
-	p->flags = 0;
+	p->flags = HAP_POLL_F_ERRHUP;
 	p->private = NULL;
 
 	p->clo  = NULL;
diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c
index 98fac85..3514f2d 100644
--- a/src/ev_kqueue.c
+++ b/src/ev_kqueue.c
@@ -358,7 +358,7 @@
 
 	p->name = "kqueue";
 	p->pref = 300;
-	p->flags = HAP_POLL_F_RDHUP;
+	p->flags = HAP_POLL_F_RDHUP | HAP_POLL_F_ERRHUP;
 	p->private = NULL;
 
 	p->clo  = NULL;
diff --git a/src/ev_poll.c b/src/ev_poll.c
index 7655ca5..47ce14b 100644
--- a/src/ev_poll.c
+++ b/src/ev_poll.c
@@ -328,7 +328,7 @@
 
 	p->name = "poll";
 	p->pref = 200;
-	p->flags = 0;
+	p->flags = HAP_POLL_F_ERRHUP;
 	p->private = NULL;
 
 	p->clo  = __fd_clo;