I was just reading the release notes for the recent OpenBSD release (https://www.openbsd.org/74.html) and see it mentions a kqueue1, which FreeBSD and NetBSD apparently already have.
Although not usually a problem, opening a file descriptor and setting it CLOEXEC in separate calls can cause a race with another thread that spawns a subprocess. So kqueue1 should be used if available, like epoll_create1.
I think it should be fine to assume this function is available on FreeBSD and NetBSD, while for now it's desirable to support OpenBSD versions older the the very latest one.
I was just reading the release notes for the recent OpenBSD release (https://www.openbsd.org/74.html) and see it mentions a
kqueue1, which FreeBSD and NetBSD apparently already have.Although not usually a problem, opening a file descriptor and setting it
CLOEXECin separate calls can cause a race with another thread that spawns a subprocess. Sokqueue1should be used if available, likeepoll_create1.I think it should be fine to assume this function is available on FreeBSD and NetBSD, while for now it's desirable to support OpenBSD versions older the the very latest one.