diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-08-10 22:43:48 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-08-10 22:43:48 +0000 |
| commit | ee1f578d627cddc71c691ba53f469ed114159454 (patch) | |
| tree | 8ef2bcbc27a8b843a0d2463ee253b3eb09d80201 /lldb/source/Host/common/Editline.cpp | |
| parent | 113cfa0772d4efe006fecf040ef3ed15e31b807e (diff) | |
| download | bcm5719-llvm-ee1f578d627cddc71c691ba53f469ed114159454.tar.gz bcm5719-llvm-ee1f578d627cddc71c691ba53f469ed114159454.zip | |
Centralize all select() calls into one place so that we can take advantage of system specific optimizations to deal with more file descriptors than FD_SETSIZE on some systems.
<rdar://problem/25325383>
https://reviews.llvm.org/D22950
llvm-svn: 278299
Diffstat (limited to 'lldb/source/Host/common/Editline.cpp')
| -rw-r--r-- | lldb/source/Host/common/Editline.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 133a9a76dd9..d23a481d168 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -20,6 +20,7 @@ #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/SelectHelper.h" using namespace lldb_private; using namespace lldb_private::line_editor; @@ -155,11 +156,10 @@ IsInputPending (FILE * file) // instead use some kind of yet-to-be-created abstraction that select-like functionality on // non-socket objects. const int fd = fileno (file); - fd_set fds; - FD_ZERO (&fds); - FD_SET (fd, &fds); - timeval timeout = { 0, 0 }; - return select (fd + 1, &fds, NULL, NULL, &timeout); + SelectHelper select_helper; + select_helper.SetTimeout(std::chrono::microseconds(0)); + select_helper.FDSetRead(fd); + return select_helper.Select().Success(); } namespace lldb_private |

