Due to marking the socket nonblocking EAGAIN should probably be checked.
Linux's man 7 pipe documents this:
O_NONBLOCK enabled, n <= PIPE_BUF
If there is room to write n bytes to the pipe, then write(2) succeeds immediately, writing all n bytes; otherwise write(2) fails, with errno set to EAGAIN.
Linux has a PIPE_BUF of 4096 while FreeBSD only has 512 bytes. So it is more likely to block on FreeBSD and other systems with small PIPE_BUFs.
Due to marking the socket nonblocking EAGAIN should probably be checked.
Linux's man 7 pipe documents this:
Linux has a PIPE_BUF of 4096 while FreeBSD only has 512 bytes. So it is more likely to block on FreeBSD and other systems with small PIPE_BUFs.
This is also discussed here (about select(2)->write(2)) https://stackoverflow.com/questions/13539066/can-write-to-a-non-blocking-fd-return-eagain-when-select-reports-it-as-writabl