Go to the documentation of this file.
43 #include <sys/event.h>
72 cur_handler =
fd_table[fd].read_handler;
76 cur_handler =
fd_table[fd].write_handler;
85 if ((cur_handler ==
NULL && handler !=
NULL)
86 || (cur_handler !=
NULL && handler ==
NULL)) {
92 if (handler !=
NULL) {
93 kep_flags = (EV_ADD | EV_ONESHOT);
95 kep_flags = EV_DELETE;
98 EV_SET(kep, (uintptr_t) fd, filter, kep_flags, 0, 0, 0);
108 perror(
"kq_update_events(): kevent()");
134 fatal(
"comm_select_init: Couldn't open kqueue fd!\n");
137 kqmax = getdtablesize();
153 Comm::SetSelect(
int fd,
unsigned int type,
PF * handler,
void *client_data, time_t timeout)
158 debugs(5, 5,
"FD " << fd <<
", type=" << type <<
159 ", handler=" << handler <<
", client_data=" << client_data <<
160 ", timeout=" << timeout);
205 struct timespec poll_time;
210 poll_time.tv_sec = msec / 1000;
212 poll_time.tv_nsec = (msec % 1000) * 1000000;
237 for (i = 0; i < num; ++i) {
238 int fd = (
int) ke[i].ident;
242 if (ke[i].flags & EV_ERROR) {
255 if (ke[i].filter == EVFILT_WRITE) {
262 if (ke[i].filter != EVFILT_WRITE && ke[i].filter != EVFILT_READ) {
void fatal(const char *message)
bool read_pending
buffering readMethod_ has data to give (regardless of socket state)
Comm::Flag DoSelect(int)
Do poll and trigger callback functions as appropriate.
static struct kevent * kqlst
static struct timespec zero_timespec
time_t getCurrentTime() STUB_RETVAL(0) int tvSubUsec(struct timeval
struct fde::_fde_flags flags
static void kq_update_events(int, short, PF *)
void SelectLoopInit(void)
Initialize the module on Squid startup.
int ignoreErrno(int ierrno)
unsigned long int select_loops
void SetSelect(int, unsigned int, PF *, void *, time_t)
Mark an FD to be watched for its IO status.
static void commKQueueRegisterWithCacheManager(void)
#define debugs(SECTION, LEVEL, CONTENT)
#define COMM_SELECT_WRITE
void QuickPollRequired(void)