| 22 Dec 2025 |
wshtk | solved: https://github.com/nix-darwin/nix-darwin/issues/1148 | 15:26:20 |
Randy Eckenrode | As far as I call tell from the man pages, which admittedly kind of suck, all ppoll does is also let you wait on signals. As far as I can tell, g_poll does not let you do that. What is ppoll also doing in this case that one couldn’t do manually with poll? | 15:31:30 |
Ihar Hrachyshka | qemu g_poll implementation: https://github.com/qemu/qemu/blob/bb7fc1543fa45bebe7eded8115f25441a9fee76e/util/qemu-timer.c#L323-L347 | 15:33:37 |
Ihar Hrachyshka | in glib, there's this in meson
if host_system in ['windows', 'darwin']
# Poll doesn't work on devices on Windows, and macOS's poll() implementation is known to be broken
glib_conf.set('BROKEN_POLL', true)
endif
| 15:34:28 |
Randy Eckenrode | I wonder what they mean by “broken”. | 15:35:04 |
Randy Eckenrode | Sometimes “broken” means “conforms to POSIX but doesn’t do what GNU does”. | 15:35:48 |
Ihar Hrachyshka | /* The poll() emulation on OS/X doesn't handle fds=NULL, nfds=0,
* so we prefer our own poll emulation.
| 15:35:50 |
Ihar Hrachyshka | the MR that mentions tap networking broken? https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2571 | 15:39:46 |
Ihar Hrachyshka | there's a "check" they use to detect a "broken" poll here: https://gitlab.gnome.org/GNOME/glib/-/commit/caecf2dda082e9c46c4157cdc10763deb8dcfc27
but afaiu it is no longer needed and just forced on darwin. wonder if the check would pass now... | 15:40:56 |
Ihar Hrachyshka | * there's a "check" they use to detect a "broken" poll here: https://gitlab.gnome.org/GNOME/glib/-/commit/caecf2dda082e9c46c4157cdc10763deb8dcfc27
but afaiu it is no longer used and just forced on darwin. wonder if the check would pass now... | 15:41:04 |
Randy Eckenrode | According to POSIX, fds is an array. My understanding is that NULL is not a valid value for an array in C. | 15:41:55 |
Ihar Hrachyshka | the check compiled with xcode clang returns 1 | 15:42:22 |