aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-06-04 07:23:55 +0000
committerAndreas Schneider <mail@cynapses.org>2009-06-04 07:23:55 +0000
commit87995db8fe50580a60c7463613e181033dbb7ef1 (patch)
tree1320749212a215d709b331f699e45feca2b913c4 /include
parent70c9da4fb03982033f32515519aa9676814d6ad8 (diff)
downloadlibssh-87995db8fe50580a60c7463613e181033dbb7ef1.tar.gz
libssh-87995db8fe50580a60c7463613e181033dbb7ef1.tar.xz
libssh-87995db8fe50580a60c7463613e181033dbb7ef1.zip
Make use of poll() and add a poll-emulation for win32.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@772 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 47652a1c..51e89c6b 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -133,6 +133,28 @@ typedef BN_CTX* bignum_CTX;
#include <sys/time.h>
#endif
+/* poll support */
+#ifdef HAVE_POLL
+#include <poll.h>
+typedef struct pollfd pollfd_t;
+#else /* HAVE_POLL */
+typedef struct pollfd_s {
+ socket_t fd; /* file descriptor */
+ short events; /* requested events */
+ short revents; /* returned events */
+} pollfd_t;
+
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
+
+typedef unsigned long int nfds_t;
+#endif /* HAVE_POLL */
+
/* wrapper.c */
MD5CTX md5_init(void);
void md5_update(MD5CTX c, const void *data, unsigned long len);
@@ -474,6 +496,9 @@ STRING *agent_sign_data(struct ssh_session *session,
struct public_key_struct *pubkey);
#endif
+/* poll.c */
+int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout);
+
/* socket.c */
struct socket;