OS X: avoid getdtablesize() by switching frmo select() to poll()

The getdtablesize() result appears not to be constant on OS X.
Creating some combination of CFStream objects, threads, and CFRunLoop
objects can cause the value to be increased by a factor of 10. Avoid
the need for getdtablesize() by switching from select() to poll().
This commit is contained in:
Matthew Flatt 2016-01-06 07:34:18 -07:00
parent 8068c1e2a5
commit 1e5da68b88
2 changed files with 10 additions and 0 deletions

View File

@ -4792,6 +4792,11 @@ fi
PREFLAGS="$PREFLAGS -DOS_X -D_DARWIN_UNLIMITED_SELECT"
try_kqueue_syscall=yes
# Although select() generally works as well as poll() on OS X,
# getdtablesize() appears not to be constant within a process,
# and that breaks static allocation of fd_sets
try_poll_syscall=yes
# ".a" is typically not useful, since we always build a ".dylib":
if test "${enable_libs}" == "" ; then
INSTALL_LIBS_ENABLE=no-install

View File

@ -873,6 +873,11 @@ case "$host_os" in
PREFLAGS="$PREFLAGS -DOS_X -D_DARWIN_UNLIMITED_SELECT"
try_kqueue_syscall=yes
# Although select() generally works as well as poll() on OS X,
# getdtablesize() appears not to be constant within a process,
# and that breaks static allocation of fd_sets
try_poll_syscall=yes
# ".a" is typically not useful, since we always build a ".dylib":
if test "${enable_libs}" == "" ; then
INSTALL_LIBS_ENABLE=no-install