0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd::info: Get sysconf() for maximum AIO operations.

This commit is contained in:
Jason Volk 2018-12-18 15:17:21 -08:00
parent 582628fb71
commit 3afce36dd4
2 changed files with 12 additions and 2 deletions

View file

@ -52,6 +52,7 @@ namespace ircd::info
extern const int glibc_version[3]; extern const int glibc_version[3];
extern const string_view glibc_version_str; extern const string_view glibc_version_str;
extern const int aio_max_ops;
extern const int aio_reqprio_max; extern const int aio_reqprio_max;
extern const size_t iov_max; extern const size_t iov_max;
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H

View file

@ -77,13 +77,14 @@ ircd::info::dump()
// This message flashes posix information about the resource limits // This message flashes posix information about the resource limits
log::debug log::debug
{ {
"AS=%lu DATA=%lu RSS=%lu NOFILE=%lu; RTTIME=%lu aio_reqprio_max=%d", "AS=%lu DATA=%lu RSS=%lu NOFILE=%lu; RTTIME=%lu aio_max_ops=%d aio_reqprio_max=%d",
rlimit_as, rlimit_as,
rlimit_data, rlimit_data,
rlimit_rss, rlimit_rss,
rlimit_nofile, rlimit_nofile,
rlimit_rttime, rlimit_rttime,
aio_reqprio_max aio_max_ops,
aio_reqprio_max,
}; };
} }
@ -199,6 +200,14 @@ ircd::info::glibc_version_str
glibc_version[2]) glibc_version[2])
); );
decltype(ircd::info::aio_max_ops)
ircd::info::aio_max_ops
{
#ifdef _SC_AIO_MAX
int(syscall(::sysconf, _SC_AIO_MAX))
#endif
};
decltype(ircd::info::aio_reqprio_max) decltype(ircd::info::aio_reqprio_max)
ircd::info::aio_reqprio_max ircd::info::aio_reqprio_max
{ {