[MAJOR] delay registering of listener sockets at startup

Some pollers such as kqueue lose their FD across fork(), meaning that
the registered file descriptors are lost too. Now when the proxies are
started by start_proxies(), the file descriptors are not registered yet,
leaving enough time for the fork() to take place and to get a new pollfd.
It will be the first call to maintain_proxies that will register them.
diff --git a/include/proto/fd.h b/include/proto/fd.h
index 9b4c632..72b2c6b 100644
--- a/include/proto/fd.h
+++ b/include/proto/fd.h
@@ -22,6 +22,7 @@
 #ifndef _PROTO_FD_H
 #define _PROTO_FD_H
 
+#include <stdio.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -47,6 +48,21 @@
 int init_pollers();
 
 /*
+ * Some pollers may lose their connection after a fork(). It may be necessary
+ * to create initialize part of them again. Returns 0 in case of failure,
+ * otherwise 1. The fork() function may be NULL if unused. In case of error,
+ * the the current poller is destroyed and the caller is responsible for trying
+ * another one by calling init_pollers() again.
+ */
+int fork_poller();
+
+/*
+ * Lists the known pollers on <out>.
+ * Should be performed only before initialization.
+ */
+int list_pollers(FILE *out);
+
+/*
  * Runs the polling loop
  */
 void run_poller();
diff --git a/include/types/fd.h b/include/types/fd.h
index 68335c0..37b5281 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -83,6 +83,8 @@
     	REGPRM2 void   (*poll)(struct poller *p, int wait_time); /* the poller itself */
 	REGPRM1 int    (*init)(struct poller *p);            /* poller initialization */
 	REGPRM1 void   (*term)(struct poller *p);            /* termination of this poller */
+	REGPRM1 int    (*test)(struct poller *p);            /* pre-init check of the poller */
+	REGPRM1 int    (*fork)(struct poller *p);            /* post-fork re-opening */
 	const char   *name;                                  /* poller name */
 	int    pref;                                         /* try pollers with higher preference first */
 };