diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-22 15:43:07 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-22 17:43:13 +0100 |
commit | c482724aa5c5d0b1391fcf958a9a3ea6ce73a085 (patch) | |
tree | 4df4a5c70268457cb7806cca1268da16e3754ae5 /src/basic/procfs-util.h | |
parent | 04ba6ed1677848969e9bd1a36642f8d1507c7d16 (diff) | |
download | systemd-c482724aa5c5d0b1391fcf958a9a3ea6ce73a085.tar.gz systemd-c482724aa5c5d0b1391fcf958a9a3ea6ce73a085.tar.bz2 systemd-c482724aa5c5d0b1391fcf958a9a3ea6ce73a085.zip |
procfs-util: expose functionality to query total memory
procfs_memory_get_current is renamed to procfs_memory_get_used, because
"current" can mean anything, including total memory, used memory, and free
memory, as long as the value is up to date.
No functional change.
Diffstat (limited to 'src/basic/procfs-util.h')
-rw-r--r-- | src/basic/procfs-util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/procfs-util.h b/src/basic/procfs-util.h index f697ed92bc..5a44e9eff7 100644 --- a/src/basic/procfs-util.h +++ b/src/basic/procfs-util.h @@ -11,4 +11,7 @@ int procfs_tasks_get_current(uint64_t *ret); int procfs_cpu_get_usage(nsec_t *ret); -int procfs_memory_get_current(uint64_t *ret); +int procfs_memory_get(uint64_t *ret_total, uint64_t *ret_used); +static inline int procfs_memory_get_used(uint64_t *ret) { + return procfs_memory_get(NULL, ret); +} |