From 87995db8fe50580a60c7463613e181033dbb7ef1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 4 Jun 2009 07:23:55 +0000 Subject: 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 --- include/libssh/priv.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') 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 #endif +/* poll support */ +#ifdef HAVE_POLL +#include +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; -- cgit