Home | History | Annotate | Download | only in libevent

Lines Matching full:evpd

141 	struct evport_data *evpd;
149 if (!(evpd = calloc(1, sizeof(struct evport_data))))
152 if ((evpd->ed_port = port_create()) == -1) {
153 free(evpd);
160 evpd->ed_fds = calloc(DEFAULT_NFDS, sizeof(struct fd_info));
161 if (evpd->ed_fds == NULL) {
162 close(evpd->ed_port);
163 free(evpd);
166 evpd->ed_nevents = DEFAULT_NFDS;
168 evpd->ed_pending[i] = -1;
172 return (evpd);
183 check_evportop(struct evport_data *evpd)
185 assert(evpd);
186 assert(evpd->ed_nevents > 0);
187 assert(evpd->ed_port > 0);
188 assert(evpd->ed_fds > 0);
196 for (i = 0; i < evpd->ed_nevents; ++i) {
200 fdi = &evpd->ed_fds[i];
402 struct evport_data *evpd = arg;
406 check_evportop(evpd);
419 while (ev->ev_fd >= factor * evpd->ed_nevents)
423 if (-1 == grow(evpd, factor)) {
428 fdi = &evpd->ed_fds[ev->ev_fd];
434 return reassociate(evpd, fdi, ev->ev_fd);
444 struct evport_data *evpd = arg;
449 check_evportop(evpd);
458 if (evpd->ed_nevents < ev->ev_fd) {
463 if (evpd->ed_pending[i] == ev->ev_fd) {
469 fdi = &evpd->ed_fds[ev->ev_fd];
477 port_dissociate(evpd->ed_port, PORT_SOURCE_FD,
489 return (reassociate(evpd, fdi, ev->ev_fd));
494 evpd->ed_pending[i] = -1;
504 struct evport_data *evpd = arg;
508 close(evpd->ed_port);
510 if (evpd->ed_fds)
511 free(evpd->ed_fds);
512 free(evpd);