diff options
author | Jack Lloyd <[email protected]> | 2019-01-28 19:05:41 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-01-31 11:07:59 -0500 |
commit | 55c7751b1eee10b5d850a500dd000cbe81d88942 (patch) | |
tree | 08c1a77eebad68f3baf74624ed04d85e626d7f91 /src/lib/utils/os_utils.h | |
parent | a0837b9a2a21562b4ff289728ed1ca9ca40d20c8 (diff) |
Add a thread pool
Diffstat (limited to 'src/lib/utils/os_utils.h')
-rw-r--r-- | src/lib/utils/os_utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/utils/os_utils.h b/src/lib/utils/os_utils.h index 37a8d3a9c..82f3aad04 100644 --- a/src/lib/utils/os_utils.h +++ b/src/lib/utils/os_utils.h @@ -90,6 +90,15 @@ size_t system_page_size(); const char* read_env_variable(const std::string& var_name); /** +* Read the value of an environment variable and convert it to an +* integer. If not set or conversion fails, returns the default value. +* +* If the process seems to be running in a privileged state (such as setuid) +* then always returns nullptr, similiar to glibc's secure_getenv. +*/ +size_t read_env_variable_sz(const std::string& var_name, size_t def_value = 0); + +/** * Request @count pages of RAM which are locked into memory using mlock, * VirtualLock, or some similar OS specific API. Free it with free_locked_pages. * |