diff options
Diffstat (limited to 'src/shared/util.h')
-rw-r--r-- | src/shared/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h index 38851237ab..a8e962ea50 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -647,4 +647,11 @@ static inline bool logind_running(void) { return access("/run/systemd/seats/", F_OK) >= 0; } +static inline unsigned decimal_str_max(unsigned x) { + unsigned ans = 1; + while (x /= 10) + ans ++; + return ans; +} + int unlink_noerrno(const char *path); |