diff --git a/src/basic/format-util.h b/src/basic/format-util.h index c603e99d82..16727c45bd 100644 --- a/src/basic/format-util.h +++ b/src/basic/format-util.h @@ -39,12 +39,18 @@ assert_cc(sizeof(gid_t) == sizeof(uint32_t)); # error Unknown timex member size #endif -#if SIZEOF_RLIM_T == 8 -# define RLIM_FMT "%" PRIu64 -#elif SIZEOF_RLIM_T == 4 -# define RLIM_FMT "%" PRIu32 +#ifdef __GLIBC__ +# if SIZEOF_RLIM_T == 8 +# define RLIM_FMT "%" PRIu64 +# elif SIZEOF_RLIM_T == 4 +# define RLIM_FMT "%" PRIu32 +# else +# error Unknown rlim_t size +# endif #else -# error Unknown rlim_t size +/* Assume musl, and it unconditionally uses unsigned long long. */ +assert_cc(SIZEOF_RLIM_T == 8); +# define RLIM_FMT "%llu" #endif #if SIZEOF_DEV_T == 8