summaryrefslogtreecommitdiffstats
path: root/src/basic/format-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/format-util.h')
-rw-r--r--src/basic/format-util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/format-util.h b/src/basic/format-util.h
index c47fa76ea8..db37c16140 100644
--- a/src/basic/format-util.h
+++ b/src/basic/format-util.h
@@ -72,11 +72,14 @@ typedef enum {
FORMAT_BYTES_TRAILING_B = 1 << 2,
} FormatBytesFlag;
-#define FORMAT_BYTES_MAX 16
+#define FORMAT_BYTES_MAX 16U
+
char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag);
+
static inline char *format_bytes(char *buf, size_t l, uint64_t t) {
return format_bytes_full(buf, l, t, FORMAT_BYTES_USE_IEC | FORMAT_BYTES_BELOW_POINT | FORMAT_BYTES_TRAILING_B);
}
+
static inline char *format_bytes_cgroup_protection(char *buf, size_t l, uint64_t t) {
if (t == CGROUP_LIMIT_MAX) {
(void) snprintf(buf, l, "%s", "infinity");