tcpdump mailing list archives

What's the correct new API to request pcap_linux to not open an eventfd


From: Bill Fenner via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Fri, 20 May 2022 10:56:33 -0700

--- Begin Message --- From: Bill Fenner <fenner () gmail com>
Date: Fri, 20 May 2022 10:56:33 -0700
I'm helping to debug a system that uses many many pcap handles, and never
calls pcap_loop - only ever pcap_next.  We've found that each pcap handle
has an associated eventfd, which is used to make sure to wake up when
pcap_breakloop() is called.  Since this code doesn't call pcap_loop or
pcap_breakloop, the eventfd is unneeded.

I'm willing to write and test the code that skips creating the breakloop_fd
- but, I wanted to discuss what the API should be.  Should there be a
pcap.c "pcap_breakloop_not_needed( pcap_t * )" that dispatches to the
implementation, or should there be a linux-specific
"pcap_linux_dont_create_eventfd( pcap_t * )"?

For this use case, portability is not important, so I would be fine with
either. I'd also be fine with less ridiculous name suggestions :-)

Thanks,
  Bill

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: