diff options
author | Andreas Schneider <asn@cynapses.org> | 2010-06-22 10:43:44 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cynapses.org> | 2010-06-22 14:44:35 +0200 |
commit | 4581b24b485a26fccccb7099371e78c6a00b5f5f (patch) | |
tree | 6d1c83a095c859ccd3a632763ca7eb7e6f5e91dd /libssh/poll.c | |
parent | 1d84821d93e8d31d3be1d81a764449426f8e4a2b (diff) | |
download | libssh-4581b24b485a26fccccb7099371e78c6a00b5f5f.tar.gz libssh-4581b24b485a26fccccb7099371e78c6a00b5f5f.tar.xz libssh-4581b24b485a26fccccb7099371e78c6a00b5f5f.zip |
poll: Added a comment to the bsd_poll() implementation.
Diffstat (limited to 'libssh/poll.c')
-rw-r--r-- | libssh/poll.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libssh/poll.c b/libssh/poll.c index 5514774..6f187e5 100644 --- a/libssh/poll.c +++ b/libssh/poll.c @@ -118,6 +118,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; |