internal: add poll() method
Add the poll() method to the internal syscall interface.
Change-Id: I6bf8b59e582214c7e607a8041a9573ef24dd5493
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/internal/sys.cpp b/internal/sys.cpp
index 7e765a9..f6a686e 100644
--- a/internal/sys.cpp
+++ b/internal/sys.cpp
@@ -55,6 +55,11 @@
return ::ioctl(fd, request, param);
}
+int SysImpl::poll(struct pollfd* fds, nfds_t nfds, int timeout) const
+{
+ return ::poll(fds, nfds, timeout);
+}
+
SysImpl sys_impl;
} // namespace internal
diff --git a/internal/sys.hpp b/internal/sys.hpp
index c013d3d..98221c3 100644
--- a/internal/sys.hpp
+++ b/internal/sys.hpp
@@ -7,6 +7,7 @@
* other pieces.
*/
+#include <poll.h>
#include <sys/mman.h>
#include <cinttypes>
@@ -31,6 +32,7 @@
virtual int munmap(void* addr, size_t length) const = 0;
virtual int getpagesize() const = 0;
virtual int ioctl(int fd, unsigned long request, void* param) const = 0;
+ virtual int poll(struct pollfd* fds, nfds_t nfds, int timeout) const = 0;
};
/**
@@ -48,6 +50,7 @@
int munmap(void* addr, size_t length) const override;
int getpagesize() const override;
int ioctl(int fd, unsigned long request, void* param) const override;
+ int poll(struct pollfd* fds, nfds_t nfds, int timeout) const override;
};
/** @brief Default instantiation of sys */