aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2015-07-05 16:55:06 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-05-02 16:40:43 +0200
commit5aaae4cb6b9b831fcc3359a64953902c97559931 (patch)
treeba585f3bfa49f4f37e1ca77475c939c58be65609 /src
parentc092101e019316975108e4afbe66802520ef510a (diff)
downloadlibssh-5aaae4cb6b9b831fcc3359a64953902c97559931.tar.gz
libssh-5aaae4cb6b9b831fcc3359a64953902c97559931.tar.xz
libssh-5aaae4cb6b9b831fcc3359a64953902c97559931.zip
events: Add functions for poll objects
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/poll.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/poll.c b/src/poll.c
index 807b0a56..142fb644 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -775,6 +775,33 @@ int ssh_event_add_fd(ssh_event event, socket_t fd, short events,
}
/**
+ * @brief Add a poll handle to the event.
+ *
+ * @param event the ssh_event
+ *
+ * @param p the poll handle
+ *
+ * @returns SSH_OK on success
+ * SSH_ERROR on failure
+ */
+int ssh_event_add_poll(ssh_event event, ssh_poll_handle p)
+{
+ return ssh_poll_ctx_add(event->ctx, p);
+}
+
+/**
+ * @brief remove a poll handle to the event.
+ *
+ * @param event the ssh_event
+ *
+ * @param p the poll handle
+ */
+void ssh_event_remove_poll(ssh_event event, ssh_poll_handle p)
+{
+ ssh_poll_ctx_remove(event->ctx,p);
+}
+
+/**
* @brief remove the poll handle from session and assign them to a event,
* when used in blocking mode.
*