Lines Matching refs:pfds
494 static void process_data_sock(int h, struct pollfd *pfds, int count)
500 if(pfds[i].revents)
503 asrt(pfds[i].fd == ts[h].ps[ps_i].pfd.fd);
507 print_events(pfds[i].revents);
508 if(IS_READ(pfds[i].revents))
512 if(IS_WRITE(pfds[i].revents))
516 if(IS_EXCEPTION(pfds[i].revents))
525 ts[h].callback(pfds[i].fd, type, flags, user_id);
530 static void prepare_poll_fds(int h, struct pollfd* pfds)
536 memset(pfds, 0, sizeof(pfds[0])*ts[h].poll_count);
547 pfds[pfd_i] = ts[h].ps[ps_i].pfd;
557 struct pollfd pfds[MAX_POLL];
558 memset(pfds, 0, sizeof(pfds));
562 prepare_poll_fds(h, pfds);
563 int ret = poll(pfds, ts[h].poll_count, -1);
572 if(pfds[0].revents) //cmd fd always is the first one
574 asrt(pfds[0].fd == ts[h].cmd_fdr);
585 process_data_sock(h, pfds, ret);