--- /dev/null
+/*
+This file is part of libmspframework
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#include <poll.h>
+#include "pollable.h"
+
+namespace Msp {
+
+short Pollable::poll(short events, int timeout)
+{
+ pollfd pfd={get_fd(), events, 0};
+ int result=::poll(&pfd, 1, timeout);
+ if(result<=0)
+ return result;
+ return pfd.revents;
+}
+
+}