aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2024-09-19 14:46:26 +0100
committerPeter Xu <peterx@redhat.com>2024-10-08 15:28:55 -0400
commitccf6b78275816c9dec84d3a40e9aa3b6ba6ebc06 (patch)
tree3580d01ae104a790e9b1ca45a68626f7ad585cd9 /util
parent3ba55a33e82c9902c211d6325bc550afcca7ddf9 (diff)
util/userfaultfd: Remove unused uffd_poll_events
uffd_poll_events has been unused since it was added; it's also just a wrapper around a plain old poll call, so doesn't add anything. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org> Reviewed-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20240919134626.166183-8-dave@treblig.org Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/userfaultfd.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/util/userfaultfd.c b/util/userfaultfd.c
index 518d5c3586..2396104f23 100644
--- a/util/userfaultfd.c
+++ b/util/userfaultfd.c
@@ -358,31 +358,3 @@ int uffd_read_events(int uffd_fd, struct uffd_msg *msgs, int count)
return (int) (res / sizeof(struct uffd_msg));
}
-
-/**
- * uffd_poll_events: poll UFFD file descriptor for read
- *
- * Returns true if events are available for read, false otherwise
- *
- * @uffd_fd: UFFD file descriptor
- * @tmo: timeout value
- */
-bool uffd_poll_events(int uffd_fd, int tmo)
-{
- int res;
- struct pollfd poll_fd = { .fd = uffd_fd, .events = POLLIN, .revents = 0 };
-
- do {
- res = poll(&poll_fd, 1, tmo);
- } while (res < 0 && errno == EINTR);
-
- if (res == 0) {
- return false;
- }
- if (res < 0) {
- error_report("uffd_poll_events() failed: errno=%i", errno);
- return false;
- }
-
- return (poll_fd.revents & POLLIN) != 0;
-}