Created attachment 248545 [details] Code demonstrating the bug (compile with/for Linux, then test on Linux, and use Linuxulator to test on FreeBSD) In Linux, setting SO_RCVTIMEO on a listening, blocking socket will cause accept(2) to return with -1 and errno=EAGAIN. Linuxulator unfortunately does not mimic this behavior, and instead exposes BSD behavior (timeout is ignored). Therefore, any Linux code relying on the timeout may fail to work correctly with FreeBSD Linux emulation. This can be fixed in a way compatible with Linux proper and FreeBSD Linuxulator (if source code access is available) by calling poll(2) prior to accept(2). However, code that is optimized for Linux proper should not require the call to poll(2) just to support the niche use case of supporting Linuxulator on FreeBSD, as that would increase the number of syscalls when running the binary on Linux proper. A small test case is attached.