From 30f51a0601407cc9e7b1161e95c1b9ff61a8335b Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 15 Dec 2020 23:38:14 +0700 Subject: [PATCH] Switch from ioctl/FIONBIO to fcntl/O_NONBLOCK. (#64) --- src/rpc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/rpc.c b/src/rpc.c index 5c6c505..3000142 100644 --- a/src/rpc.c +++ b/src/rpc.c @@ -20,6 +20,7 @@ static char *id = "$Id: rpc.c,v 1.3 2001/12/24 01:09:06 sybalsky Exp $ Copyright /************************************************************************/ #ifndef DOS +#include #include #include #include @@ -29,7 +30,6 @@ static char *id = "$Id: rpc.c,v 1.3 2001/12/24 01:09:06 sybalsky Exp $ Copyright #include #include #include -#include #include /* for memset/memcpy */ #endif /* DOS */ #include "lispemul.h" @@ -121,12 +121,8 @@ LispPTR rpc(LispPTR *args) dontblock = 1; -/* The sockets that rpc controls don't block */ -#ifdef SYSVONLY -/* NEED TO FILL THIS IN PROPERLY */ -#else - (void)ioctl(s, FIONBIO, &dontblock); -#endif /* SYSVONLY */ + /* The sockets that rpc controls don't block */ + fcntl(s, F_SETFL, fcntl(s, F_GETFL, 0) | O_NONBLOCK); memset((char *)&sin, 0, sizeof(sin)); sin.sin_family = AF_INET;