fdManager uses poll() on Windows and RTEMS too

RTEMS needs to use the "new" network stack
Windows has poll since Vista
Don't use poll on cygwin: it emulates poll() using select().
This commit is contained in:
2025-01-23 10:30:38 +01:00
parent 57c0295024
commit cbbbd67843
2 changed files with 26 additions and 21 deletions

View File

@@ -19,28 +19,33 @@
// 1) This library is not thread safe
//
#include <algorithm>
#define instantiateRecourceLib
#include "epicsAssert.h"
#include "epicsThread.h"
#include "fdManager.h"
#include "locationException.h"
using std :: max;
fdManager fileDescriptorManager;
static const unsigned mSecPerSec = 1000u;
static const unsigned uSecPerSec = 1000u * mSecPerSec;
#ifdef FDMGR_USE_POLL
#ifdef _WIN32
#define poll WSAPoll
#endif
static const int PollEvents[] = { // must match fdRegType
POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR,
POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR,
POLLPRI};
#endif
#ifdef FDMGR_USE_SELECT
#include <algorithm>
using std :: max;
#endif
fdManager fileDescriptorManager;
static const unsigned mSecPerSec = 1000u;
static const unsigned uSecPerSec = 1000u * mSecPerSec;
//
// fdManager::fdManager()
//