[add] - implement set_non_blocking for socket

libnfs-4.0.0-vitalif
unknown 2011-09-03 00:27:02 +02:00 committed by Ronnie Sahlberg
parent f5a488524d
commit 99c14c9b81
1 changed files with 3 additions and 1 deletions

View File

@ -66,9 +66,11 @@ static int rpc_disconnect_requeue(struct rpc_context *rpc);
static void set_nonblocking(int fd)
{
int v = 0;
#if defined(WIN32)
long nonblocking=1;
v = ioctlsocket(fd, FIONBIO,&nonblocking);
#else
unsigned v;
v = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, v | O_NONBLOCK);
#endif //FIXME