0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::info: Query the RLIMIT_NOFILE; minor fixes.

This commit is contained in:
Jason Volk 2018-04-20 12:37:17 -07:00
parent fcf17db132
commit 09ff713743
2 changed files with 21 additions and 4 deletions

View file

@ -44,9 +44,10 @@ namespace ircd::info
extern const size_t hardware_concurrency;
extern const size_t destructive_interference;
extern const size_t constructive_interference;
extern const uint64_t rlimit_as;
extern const uint64_t rlimit_data;
extern const uint64_t rlimit_rss;
extern const size_t rlimit_as;
extern const size_t rlimit_data;
extern const size_t rlimit_rss;
extern const size_t rlimit_nofile;
#ifdef HAVE_SYS_UTSNAME_H
extern const ::utsname utsname;
#endif

View file

@ -66,6 +66,16 @@ ircd::info::init()
destructive_interference,
constructive_interference
};
// This message flashes posix information about the resource limits
log::debug
{
"AS=%lu DATA=%lu RSS=%lu NOFILE=%zu",
rlimit_as,
rlimit_data,
rlimit_rss,
rlimit_nofile
};
}
extern "C" const char *const
@ -182,7 +192,7 @@ static uint64_t
_get_rlimit(const int &resource)
{
rlimit rlim;
ircd::syscall(getrlimit, RLIMIT_AS, &rlim);
ircd::syscall(getrlimit, resource, &rlim);
return rlim.rlim_cur;
}
#else
@ -211,6 +221,12 @@ ircd::info::rlimit_rss
_get_rlimit(RLIMIT_RSS)
};
decltype(ircd::info::rlimit_nofile)
ircd::info::rlimit_nofile
{
_get_rlimit(RLIMIT_NOFILE)
};
decltype(ircd::info::max_align)
ircd::info::max_align
{