* FD_POLL_OUT remains set as long as the fd accepts to write data.
* FD_POLL_ERR and FD_POLL_ERR remain set forever (until processed).
*/
-#define FD_POLL_IN 0x01
-#define FD_POLL_PRI 0x02
-#define FD_POLL_OUT 0x04
-#define FD_POLL_ERR 0x08
-#define FD_POLL_HUP 0x10
+#define FD_POLL_IN 0x00000100
+#define FD_POLL_PRI 0x00000200
+#define FD_POLL_OUT 0x00000400
+#define FD_POLL_ERR 0x00000800
+#define FD_POLL_HUP 0x00001000
#define FD_POLL_UPDT_MASK (FD_POLL_IN | FD_POLL_PRI | FD_POLL_OUT)
void (*iocb)(int fd); /* I/O handler */
void *owner; /* the connection or listener associated with this fd, NULL if closed */
unsigned char state; /* FD state for read and write directions (FD_EV_*) */
- unsigned char ev; /* event seen in return of poll() : FD_POLL_* */
+ unsigned int ev; /* event seen in return of poll() : FD_POLL_* */
unsigned char linger_risk:1; /* 1 if we must kill lingering before closing */
unsigned char cloned:1; /* 1 if a cloned socket, requires EPOLL_CTL_DEL on close */
unsigned char initialized:1; /* 1 if init phase was done on this fd (e.g. set non-blocking) */
* doesn't need to also pass FD_EV_SHUT_*, it's implied. ERR and SHUT are
* allowed to be reported regardless of R/W readiness.
*/
-static inline void fd_update_events(int fd, unsigned char evts)
+static inline void fd_update_events(int fd, uint evts)
{
unsigned long locked = atleast2(fdtab[fd].thread_mask);
- unsigned char old, new;
- int new_flags, must_stop;
+ uint old, new;
+ uint new_flags, must_stop;
new_flags =
((evts & FD_EV_READY_R) ? FD_POLL_IN : 0) |
(fdt.state & FD_EV_ACTIVE_R) ? 'A' : 'a',
(fdt.state & FD_EV_READY_W) ? 'R' : 'r',
(fdt.state & FD_EV_ACTIVE_W) ? 'A' : 'a',
- fdt.ev,
+ fdt.ev >> 8,
(fdt.ev & FD_POLL_HUP) ? 'H' : 'h',
(fdt.ev & FD_POLL_ERR) ? 'E' : 'e',
(fdt.ev & FD_POLL_OUT) ? 'O' : 'o',