Added net_set_nonblocking for Solaris.
This commit is contained in:
parent
cd389742e6
commit
cfb450c3fc
|
@ -182,8 +182,18 @@ int net_set_nonblocking(int fd, int toggle)
|
|||
#ifdef WINSOCK
|
||||
u_long on = toggle ? 1 : 0;
|
||||
ret = ioctlsocket(fd, FIONBIO, &on);
|
||||
#else
|
||||
#ifdef __sun__
|
||||
int flags = fcntl(fd, F_GETFL, 0);
|
||||
if (flags != -1)
|
||||
{
|
||||
if (toggle) flags |= O_NONBLOCK;
|
||||
else flags &= ~O_NONBLOCK;
|
||||
ret = fcntl(fd, F_SETFL, flags);
|
||||
}
|
||||
#else
|
||||
ret = ioctl(fd, FIONBIO, &toggle);
|
||||
#endif
|
||||
#endif
|
||||
if (ret == -1)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue