aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/os_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils/os_utils.h')
-rw-r--r--src/lib/utils/os_utils.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/utils/os_utils.h b/src/lib/utils/os_utils.h
index 0030f88c9..3335463f7 100644
--- a/src/lib/utils/os_utils.h
+++ b/src/lib/utils/os_utils.h
@@ -1,6 +1,6 @@
/*
* OS specific utility functions
-* (C) 2015 Jack Lloyd
+* (C) 2015,2016 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -14,6 +14,26 @@ namespace Botan {
namespace OS {
+/**
+* Returns the OS assigned process ID, if available. Otherwise returns 0.
+*/
+uint32_t get_process_id();
+
+/**
+* Returns the value of the hardware cycle counter, if available.
+* Returns 0 if not available. On Windows uses QueryPerformanceCounter.
+* On other platforms reads the native cycle counter directly.
+* The epoch and update rate are arbitrary and may not be constant
+* (depending on the hardware).
+*/
+uint64_t get_processor_timestamp();
+
+/**
+* Returns the value of the system clock with best resolution available,
+* normalized to nanoseconds resolution.
+*/
+uint64_t get_system_timestamp_ns();
+
/*
* Returns the maximum amount of memory (in bytes) we could/should
* hyptothetically allocate. Reads "BOTAN_MLOCK_POOL_SIZE" from
@@ -22,9 +42,9 @@ namespace OS {
size_t get_memory_locking_limit();
/*
-* Request so many bytes of page-aligned RAM locked into memory OS
-* calls (mlock, VirtualLock, or similar). Returns null on failure. The
-* memory returned is zeroed. Free it with free_locked_pages.
+* Request so many bytes of page-aligned RAM locked into memory using
+* mlock, VirtualLock, or similar. Returns null on failure. The memory
+* returned is zeroed. Free it with free_locked_pages.
*/
void* allocate_locked_pages(size_t length);