From 80ff0a062a990352cf5435ccde695d92fe3e8674 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2025 20:56:41 +0100 Subject: [PATCH] system/EpollFD: add method GetFileDescriptor() --- src/system/EpollFD.hxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/system/EpollFD.hxx b/src/system/EpollFD.hxx index 7d2d4b5aa..9bcc2d3a9 100644 --- a/src/system/EpollFD.hxx +++ b/src/system/EpollFD.hxx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann -#ifndef EPOLL_FD_HXX -#define EPOLL_FD_HXX +#pragma once #include "io/UniqueFileDescriptor.hxx" @@ -25,6 +24,10 @@ public: EpollFD(EpollFD &&) = default; EpollFD &operator=(EpollFD &&) = default; + FileDescriptor GetFileDescriptor() const noexcept { + return fd; + } + int Wait(epoll_event *events, int maxevents, int timeout) noexcept { return ::epoll_wait(fd.Get(), events, maxevents, timeout); } @@ -53,5 +56,3 @@ public: return Control(EPOLL_CTL_DEL, _fd, nullptr); } }; - -#endif