From e67fafd60f3985399a0586e4743b6c81d9a412a4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Jun 2010 10:43:44 +0200 Subject: poll: Added a comment to the bsd_poll() implementation. --- libssh/poll.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libssh') 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 #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; -- cgit