system/EpollFD: add method GetFileDescriptor()
This commit is contained in:

committed by
Max Kellermann

parent
24bcf44a47
commit
80ff0a062a
@ -1,8 +1,7 @@
|
|||||||
// SPDX-License-Identifier: BSD-2-Clause
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
// author: Max Kellermann <max.kellermann@gmail.com>
|
// author: Max Kellermann <max.kellermann@gmail.com>
|
||||||
|
|
||||||
#ifndef EPOLL_FD_HXX
|
#pragma once
|
||||||
#define EPOLL_FD_HXX
|
|
||||||
|
|
||||||
#include "io/UniqueFileDescriptor.hxx"
|
#include "io/UniqueFileDescriptor.hxx"
|
||||||
|
|
||||||
@ -25,6 +24,10 @@ public:
|
|||||||
EpollFD(EpollFD &&) = default;
|
EpollFD(EpollFD &&) = default;
|
||||||
EpollFD &operator=(EpollFD &&) = default;
|
EpollFD &operator=(EpollFD &&) = default;
|
||||||
|
|
||||||
|
FileDescriptor GetFileDescriptor() const noexcept {
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
int Wait(epoll_event *events, int maxevents, int timeout) noexcept {
|
int Wait(epoll_event *events, int maxevents, int timeout) noexcept {
|
||||||
return ::epoll_wait(fd.Get(), events, maxevents, timeout);
|
return ::epoll_wait(fd.Get(), events, maxevents, timeout);
|
||||||
}
|
}
|
||||||
@ -53,5 +56,3 @@ public:
|
|||||||
return Control(EPOLL_CTL_DEL, _fd, nullptr);
|
return Control(EPOLL_CTL_DEL, _fd, nullptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user