Hi,
On 10/15/25 00:18, Samuel Thibault wrote: >> How difficult would be implementing such a thing? a selectable fd that would >> be signaled by gnumach when there is data in the bpf filter? > > Basically, you need something that answers both io_read and io_select > requests, so some translator. Better just reuse what is already > implemented, by using a pipe. Can't gnumach itself answer to those ops? If a translator is needed, the best option would be emulating BSD and create the /dev/bpf translator, so dhcpcd wouldn't need libpcap at all. Anyway, the libpcap approach is already working, so just thinkg out loud. >> I decided to leave them like "just in case" but theoretically EBADF should >> never happen with the final implementation when the thread is cancelled by >> pthread_cancel() before closing the pipe. > > Yes, so better let the code warn if that's not the case. > I made some changes in the patch to implement your suggestions. I'm gonna send it to upstream if nobody else has comments.
