int evloop_init(void) { if (timeheap_init() != 0) return -1; m_kq = kqueue(); return m_kq >= 0 ? 0 : -1; }
int evloop_init(void) { int m_epfd; if (timeheap_init() != 0) return -1; m_epfd = epoll_create(getdtablesize()); return m_epfd >= 0 ? m_epfd : -1; }
int evloop_init(void) { if (timeheap_init() != 0) return -1; m_cap = POLL_INIT_SIZE; m_size = 0; if ((m_pfds = calloc(m_cap, sizeof(*m_pfds))) == NULL) return -1; if ((m_pevs = calloc(m_cap, sizeof(*m_pevs))) == NULL) { free(m_pfds); return -1; } return 0; }