1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-18 17:07:24 +00:00

Switch from ioctl/FIONBIO to fcntl/O_NONBLOCK. (#64)

This commit is contained in:
Bruce Mitchener 2020-12-15 23:38:14 +07:00 committed by GitHub
parent 69adf2ffd3
commit 30f51a0601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
@ -29,7 +30,6 @@ static char *id = "$Id: rpc.c,v 1.3 2001/12/24 01:09:06 sybalsky Exp $ Copyright
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <string.h> /* 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;