/* info/config bits */
#define FD_LINGER_RISK_BIT 16 /* must kill lingering before closing */
+#define FD_CLONED_BIT 17 /* cloned socket, requires EPOLL_CTL_DEL on close */
/* and flag values */
/* information/configuration flags */
#define FD_LINGER_RISK (1U << FD_LINGER_RISK_BIT)
+#define FD_CLONED (1U << FD_CLONED_BIT)
/* This is the value used to mark a file descriptor as dead. This value is
* negative, this is important so that tests on fd < 0 properly match. It
void (*iocb)(int fd); /* I/O handler */
void *owner; /* the connection or listener associated with this fd, NULL if closed */
unsigned int state; /* FD state for read and write directions (FD_EV_*) + FD_POLL_* */
- 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) */
unsigned char et_possible:1; /* 1 if edge-triggered is possible on this FD */
unsigned char exported:1; /* 1 if the FD is exported and must not be closed */
(fdt.state & FD_POLL_PRI) ? 'P' : 'p',
(fdt.state & FD_POLL_IN) ? 'I' : 'i',
(fdt.state & FD_LINGER_RISK) ? 'L' : 'l',
- fdt.cloned ? 'C' : 'c',
+ (fdt.state & FD_CLONED) ? 'C' : 'c',
fdt.thread_mask, fdt.update_mask,
fdt.owner,
fdt.iocb);
*/
static void __fd_clo(int fd)
{
- if (unlikely(fdtab[fd].cloned)) {
+ if (unlikely(fdtab[fd].state & FD_CLONED)) {
unsigned long m = polled_mask[fd].poll_recv | polled_mask[fd].poll_send;
struct epoll_event ev;
int i;