Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce5246ab authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Expose TakeXXXFd from UDS's ChannelEventReceiver"

parents a0f16083 3f28530a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -54,6 +54,14 @@ class ChannelEventReceiver {
  BorrowedHandle pollhup_event_fd() const { return pollhup_event_fd_.Borrow(); }
  BorrowedHandle data_fd() const { return data_fd_.Borrow(); }

  // Moves file descriptors out of ChannelEventReceiver. Note these operations
  // immediately invalidates the receiver.
  std::tuple<LocalHandle, LocalHandle, LocalHandle> TakeFds() {
    epoll_fd_.Close();
    return {std::move(data_fd_), std::move(pollin_event_fd_),
            std::move(pollhup_event_fd_)};
  }

  Status<int> GetPendingEvents() const;
  Status<int> PollPendingEvents(int timeout_ms) const;