mirror of
https://github.com/monero-project/monero.git
synced 2025-12-22 15:16:40 -08:00
wallet: warn if lockable memory limit is too low
This commit is contained in:
@@ -728,6 +728,21 @@ std::string get_nix_version_display_string()
|
||||
return true;
|
||||
}
|
||||
|
||||
ssize_t get_lockable_memory()
|
||||
{
|
||||
#ifdef __GLIBC__
|
||||
struct rlimit rlim;
|
||||
if (getrlimit(RLIMIT_MEMLOCK, &rlim) < 0)
|
||||
{
|
||||
MERROR("Failed to determine the lockable memory limit");
|
||||
return -1;
|
||||
}
|
||||
return rlim.rlim_cur;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool on_startup()
|
||||
{
|
||||
mlog_configure("", true);
|
||||
|
||||
Reference in New Issue
Block a user