Skip to content

Commit

Permalink
system/EpollFD: add method GetFileDescriptor()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Feb 3, 2025
1 parent 47deba6 commit f637d2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/system/EpollFD.hxx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>

#ifndef EPOLL_FD_HXX
#define EPOLL_FD_HXX
#pragma once

#include "io/UniqueFileDescriptor.hxx"

Expand All @@ -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);
}
Expand Down Expand Up @@ -53,5 +56,3 @@ public:
return Control(EPOLL_CTL_DEL, _fd, nullptr);
}
};

#endif

0 comments on commit f637d2e

Please sign in to comment.