Home | History | Annotate | Download | only in utils

Lines Matching refs:eloop

14 #include "eloop.h"
27 WPA_TRACE_REF(eloop);
38 WPA_TRACE_REF(eloop);
81 static struct eloop_data eloop;
88 wpa_trace_show("eloop SIGSEGV");
98 wpa_trace_add_ref(&table->table[i], eloop,
112 wpa_trace_remove_ref(&table->table[i], eloop,
129 os_memset(&eloop, 0, sizeof(eloop));
130 dl_list_init(&eloop.timeout);
145 if (sock > eloop.max_sock)
148 new_max_sock = eloop.max_sock;
154 if (new_max_sock >= eloop.max_pollfd_map) {
156 nmap = os_realloc_array(eloop.pollfds_map, new_max_sock + 50,
161 eloop.max_pollfd_map = new_max_sock + 50;
162 eloop.pollfds_map = nmap;
165 if (eloop.count + 1 > eloop.max_poll_fds) {
167 int nmax = eloop.count + 1 + 50;
168 n = os_realloc_array(eloop.pollfds, nmax,
173 eloop.max_poll_fds = nmax;
174 eloop.pollfds = n;
191 eloop.max_sock = new_max_sock;
192 eloop.count++;
221 eloop.count--;
410 wpa_printf(MSG_INFO, "ELOOP: remaining socket: "
417 wpa_trace_dump_funcname("eloop unregistered socket "
420 wpa_trace_dump("eloop sock", &table->table[i]);
445 return &eloop.readers;
447 return &eloop.writers;
449 return &eloop.exceptions;
498 wpa_printf(MSG_DEBUG, "ELOOP: Too long timeout (secs=%u) to "
511 wpa_trace_add_ref(timeout, eloop, eloop_data);
516 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) {
522 dl_list_add_tail(&eloop.timeout, &timeout->list);
531 wpa_trace_remove_ref(timeout, eloop, timeout->eloop_data);
543 dl_list_for_each_safe(timeout, prev, &eloop.timeout,
570 dl_list_for_each_safe(timeout, prev, &eloop.timeout,
591 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) {
605 wpa_printf(MSG_ERROR, "eloop: could not process SIGINT or SIGTERM in "
620 if ((sig == SIGINT || sig == SIGTERM) && !eloop.pending_terminate) {
623 eloop.pending_terminate = 1;
629 eloop.signaled++;
630 for (i = 0; i < eloop.signal_count; i++) {
631 if (eloop.signals[i].sig == sig) {
632 eloop.signals[i].signaled++;
643 if (eloop.signaled == 0)
645 eloop.signaled = 0;
647 if (eloop.pending_terminate) {
651 eloop.pending_terminate = 0;
654 for (i = 0; i < eloop.signal_count; i++) {
655 if (eloop.signals[i].signaled) {
656 eloop.signals[i].signaled = 0;
657 eloop.signals[i].handler(eloop.signals[i].sig,
658 eloop.signals[i].user_data);
669 tmp = os_realloc_array(eloop.signals, eloop.signal_count + 1,
674 tmp[eloop.signal_count].sig = sig;
675 tmp[eloop.signal_count].user_data = user_data;
676 tmp[eloop.signal_count].handler = handler;
677 tmp[eloop.signal_count].signaled = 0;
678 eloop.signal_count++;
679 eloop.signals = tmp;
727 while (!eloop.terminate &&
728 (!dl_list_empty(&eloop.timeout) || eloop.readers.count > 0 ||
729 eloop.writers.count > 0 || eloop.exceptions.count > 0)) {
731 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout,
749 &eloop.readers, &eloop.writers, &eloop.exceptions,
750 eloop.pollfds, eloop.pollfds_map,
751 eloop.max_pollfd_map);
752 res = poll(eloop.pollfds, num_poll_fds,
760 eloop_sock_table_set_fds(&eloop.readers, rfds);
761 eloop_sock_table_set_fds(&eloop.writers, wfds);
762 eloop_sock_table_set_fds(&eloop.exceptions, efds);
763 res = select(eloop.max_sock + 1, rfds, wfds, efds,
773 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout,
792 eloop_sock_table_dispatch(&eloop.readers, &eloop.writers,
793 &eloop.exceptions, eloop.pollfds_map,
794 eloop.max_pollfd_map);
796 eloop_sock_table_dispatch(&eloop.readers, rfds);
797 eloop_sock_table_dispatch(&eloop.writers, wfds);
798 eloop_sock_table_dispatch(&eloop.exceptions, efds);
814 eloop.terminate = 1;
824 dl_list_for_each_safe(timeout, prev, &eloop.timeout,
833 wpa_printf(MSG_INFO, "ELOOP: remaining timeout: %d.%06d "
837 wpa_trace_dump_funcname("eloop unregistered timeout handler",
839 wpa_trace_dump("eloop timeout", timeout);
842 eloop_sock_table_destroy(&eloop.readers);
843 eloop_sock_table_destroy(&eloop.writers);
844 eloop_sock_table_destroy(&eloop.exceptions);
845 os_free(eloop.signals);
848 os_free(eloop.pollfds);
849 os_free(eloop.pollfds_map);
856 return eloop.terminate;