RFR: Make printing of rlim_t values more portable
mikael.vidstedt at oracle.com
Wed Apr 12 00:34:31 UTC 2017
os::Posix::print_rlimit_info has some logic to print a bunch of limit (rlim_t) values. posix doesn’t specify which exact type rlim_t has (just that it’s an unsigned integer type). Most platforms define it as an unsigned long, but in musl it’s an unsigned long long, which means that the print format (%lu) doesn’t match.
There are a few different alternatives to fixing this, but Mikael Gerdin suggested upcasting the value to a 64-bit unsigned type and using the corresponding print format (UINT64_FORMAT). This should take care of the problem.
More information about the portola-dev