!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

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

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


SenderMessageTime
22 Dec 2025
@reckenrode:matrix.orgRandy Eckenrode What happens if you define your own FD_SETSIZE? 17:04:52
@ihar.hrachyshka:matrix.orgIhar HrachyshkaI assume that since libSystem is as it was compiled with the 1024 limit, it won't do much. but let me check.17:05:51
@reckenrode:matrix.orgRandy EckenrodeThe checks are inline functions in the header.17:06:44
@reckenrode:matrix.orgRandy Eckenrode Or setting _DARWIN_UNLIMITED_SELECT with select? 17:07:08
@reckenrode:matrix.orgRandy Eckenrode * Or defining _DARWIN_UNLIMITED_SELECT when using select? 17:07:19
@reckenrode:matrix.orgRandy Eckenrode * Or defining _DARWIN_UNLIMITED_SELECT when using select or pselect? 17:07:42
@ihar.hrachyshka:matrix.orgIhar Hrachyshka

I copied half of that file, commented out include for select.h, removed the check and now it works

=== Test 2: pselect() with FD >= FD_SETSIZE (DANGEROUS!) ===
This test intentionally demonstrates undefined behavior
Attempting to add FD 1024 to fd_set (FD_SETSIZE=1024)...
WARNING: This will cause undefined behavior!
Before FD_SET: fd_set memory looks normal
fd_set bytes before: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Calling FD_SET(1024, &dangerous_set)...
fd_set bytes after:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Memory corruption may have occurred!
Attempting pselect() with corrupted fd_set...
pselect() unexpectedly succeeded with 0 ready FDs

I don't know if "works" means more than "it returned 0" but...

17:11:29
@reckenrode:matrix.orgRandy EckenrodeWhat if you just set that define before including any headers?17:13:44
@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

Show newer messages


Back to Room ListRoom Version: 6