!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1176 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org192 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
22 Dec 2025
@reckenrode:matrix.orgRandy Eckenrode With both select and pselect? 17:14:00
@reckenrode:matrix.orgRandy Eckenrodehttps://developer.apple.com/library/archive/releasenotes/Darwin/SymbolVariantsRelNotes/index.html17:16:13
@reckenrode:matrix.orgRandy Eckenrode

Setting the _DARWIN_UNLIMITED_SELECT macro will select the extension variants of select() and pselect(), which uses the $DARWIN_EXTSN suffix. The extended versions do not fail if the first argument is greater than FD_SETSIZE. This was the original BSD behavior.

17:17:01
@ihar.hrachyshka:matrix.orgIhar Hrachyshkayes defining just _DARWIN_UNLIMITED_SELECT works too.17:21:01
@ihar.hrachyshka:matrix.orgIhar HrachyshkaI will try to enable it for glib and see if it fixes qemu. that said... any reason to ever not have it set when running on darwin?17:29:02
@reckenrode:matrix.orgRandy EckenrodeNot sure. Probably not. The check is for POSIX compliance.17:31:49
@reckenrode:matrix.orgRandy Eckenrodehttps://devblogs.microsoft.com/oldnewthing/20221102-00/?p=10734317:34:21
@reckenrode:matrix.orgRandy Eckenrode * https://devblogs.microsoft.com/oldnewthing/20221102-00/? 17:34:30
@reckenrode:matrix.orgRandy Eckenrode * 17:34:35
@ihar.hrachyshka:matrix.orgIhar Hrachyshka

claims on how this works

Apple's libc has a pretty wild feature (guarded by _DARWIN_UNLIMITED_SELECT, on by default) which allows fds above FD_SETSIZE. It works by checking the address of the fd_set: if it's within the current thread's stack, then the call will fail, under the assumption that it's a stack-allocated fd_set.
But if the address is NOT within the current thread's stack, select() assumes you know what you're doing and will allow the call, trusting you have allocated sufficient memory for the high fds in the fd_set.

so there may be some condition to fulfill to make it work.

which I think is not satisfied for qemu main loop fds?

17:34:35
@reckenrode:matrix.orgRandy EckenrodeThat Old New Thing article provides a good explanation why things are the way they are.17:37:21
@ihar.hrachyshka:matrix.orgIhar Hrachyshka(taht said, in my test program I also define fds[] on stack and it "succeeds" so maybe claims are wrong)17:38:40
@reckenrode:matrix.orgRandy EckenrodeWhat about the emulation? How does it allocate the set?17:39:46
@ihar.hrachyshka:matrix.orgIhar Hrachyshka"emulation"? you mean g_poll macos implementation?17:40:35

Show newer messages


Back to Room ListRoom Version: 6