diff --git a/BasiliskII/src/Unix/ether_unix.cpp b/BasiliskII/src/Unix/ether_unix.cpp index d5b32501..8c95c8a5 100644 --- a/BasiliskII/src/Unix/ether_unix.cpp +++ b/BasiliskII/src/Unix/ether_unix.cpp @@ -20,6 +20,19 @@ #include "sysdeps.h" +/* + * NOTES concerning MacOS X issues: + * - poll() does not exist in 10.2.8, but is available in 10.4.4 + * - select(), and very likely poll(), are not cancellation points. So + * the ethernet thread doesn't stop on exit. An explicit check is + * performed to workaround this problem. + */ +#if (defined __APPLE__ && defined __MACH__) || ! defined HAVE_POLL +#define USE_POLL 0 +#else +#define USE_POLL 1 +#endif + #ifdef HAVE_SYS_POLL_H #include #endif @@ -815,7 +828,7 @@ static void *receive_func(void *arg) for (;;) { // Wait for packets to arrive -#if HAVE_POLL +#if USE_POLL struct pollfd pf = {fd, POLLIN, 0}; int res = poll(&pf, 1, -1); #else