aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-06-22 10:43:44 +0200
committerAndreas Schneider <asn@cynapses.org>2010-06-22 14:45:08 +0200
commite67fafd60f3985399a0586e4743b6c81d9a412a4 (patch)
tree798a243e03e2ee3f7911f71f4962c2722554f3b2
parenta2a98fb5bc1462d2338c5c2dbe799d8e72d23630 (diff)
downloadlibssh-e67fafd60f3985399a0586e4743b6c81d9a412a4.tar.gz
libssh-e67fafd60f3985399a0586e4743b6c81d9a412a4.tar.xz
libssh-e67fafd60f3985399a0586e4743b6c81d9a412a4.zip
poll: Added a comment to the bsd_poll() implementation.
-rw-r--r--libssh/poll.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index 1837d25e..59d37647 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -93,6 +93,16 @@ static HINSTANCE hlib;
#include <sys/time.h>
#endif
+
+/*
+ * This is a poll(2)-emulation using select for systems not providing a native
+ * poll implementation.
+ *
+ * Keep in mind that select is terribly inefficient. The interface is simply not
+ * meant to be used with maximum descriptor value greater, say, 32 or so. With
+ * a value as high as 1024 on Linux you'll pay dearly in every single call.
+ * poll() will be orders of magnitude faster.
+ */
static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
fd_set readfds, writefds, exceptfds;
struct timeval tv, *ptv;