30 flags = fcntl(sock, F_GETFL);
33 if (fcntl(sock, F_SETFL, (flags | O_NONBLOCK)) == -1)
37 unsigned long ioctlsocket_ret = 1;
40 return (ioctlsocket(sock, FIONBIO, &ioctlsocket_ret) == 0);
54 flags = fcntl(sock, F_GETFL);
57 if (fcntl(sock, F_SETFL, (flags & ~O_NONBLOCK)) == -1)
61 unsigned long ioctlsocket_ret = 0;
64 return (ioctlsocket(sock, FIONBIO, &ioctlsocket_ret) == 0);
bool pg_set_noblock(pgsocket sock)
bool pg_set_block(pgsocket sock)