--- trealla-3.0.12/src/network.c.orig +++ trealla-3.0.12/src/network.c @@ -4,6 +4,9 @@ #include #include #include +#include +#include +#include #if USE_OPENSSL #include @@ -327,8 +330,8 @@ void tpl_set_nonblocking(stream *str) { #if !defined(_WIN32) && !defined(__wasi__) - unsigned long flag = 1; - ioctl(fileno(str->fp_in), FIONBIO, &flag); + int flags = fcntl(fileno(str->fp_in), F_GETFL, 0); + fcntl(fileno(str->fp_in), F_SETFL, flags | O_NONBLOCK); #endif }