From 2b62123459ca51735b0bdc2ca1a5a8b289177b4d Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Fri, 3 Oct 2025 23:27:29 +0100 Subject: [PATCH] SimRsim.c: removal of pre-POSIX.1-2001 select() interface ifdefs POSIX.1-2001 introduced fd_set for use with select() and all current systems support POSIX. --- sim/SimRsim.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sim/SimRsim.c b/sim/SimRsim.c index 653db1bf..6db06b8c 100644 --- a/sim/SimRsim.c +++ b/sim/SimRsim.c @@ -629,11 +629,7 @@ SimFillBuffer( int charsRead = 0; char *temp; int n, nfd; -#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN) fd_set readfds, writefds, exceptfds; -#else - int nr, nex; -#endif /* SYSV */ struct timeval timeout; @@ -645,10 +641,8 @@ SimFillBuffer( /* read reply from Rsim */ -#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN) FD_ZERO(&readfds); FD_ZERO(&exceptfds); -#endif /* SYSV */ ASSERT(pipeIn >= 0 && pipeIn < FD_SETSIZE, "pipeIn>=0&&pipeIn= FD_SETSIZE) @@ -661,18 +655,11 @@ SimFillBuffer( try_again: -#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN) FD_SET(pipeIn, &readfds); FD_ZERO(&writefds); FD_SET(pipeIn, &exceptfds); n = select(nfd, &readfds, &writefds, &exceptfds, &timeout); -#else /* !SYSV */ - nr = nex = 1 << pipeIn; - n = select(nfd, &nr, NULL, &nex, &timeout); - -#endif - if (n == 0) return 0; /* select() timed out */