0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::fs: Add optional init for aio.

This commit is contained in:
Jason Volk 2022-09-06 11:02:02 -07:00
parent 10201c11eb
commit 83799b555c
2 changed files with 11 additions and 2 deletions

View file

@ -72,7 +72,7 @@ namespace ircd::fs
struct [[gnu::visibility("hidden")]]
ircd::fs::init
{
aio::init _aio_;
std::optional<aio::init> _aio_;
init();
~init() noexcept;

View file

@ -48,7 +48,11 @@ ircd::fs::rlimit_nofile
//
ircd::fs::init::init()
:_aio_{std::nullopt}
{
if(support::aio)
_aio_.emplace();
init_dump_info();
}
@ -222,7 +226,12 @@ ircd::fs::support::rwf_write_life
decltype(ircd::fs::support::aio)
ircd::fs::support::aio
{
IRCD_USE_AIO
#if IRCD_USE_AIO == 1
info::kernel_version[0] > 2 ||
(info::kernel_version[0] >= 2 && info::kernel_version[1] >= 5)
#else
false
#endif
};
void