8180039: Use more portable print format/arguments for rlim_t
authormikael
Thu, 11 May 2017 08:40:32 -0700
changeset 46451 a4a8613c08e9
parent 46450 7a361ede7817
child 46452 0388e4c03d6f
8180039: Use more portable print format/arguments for rlim_t Reviewed-by: dholmes, mgerdin, stuefe
hotspot/src/os/posix/vm/os_posix.cpp
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Wed May 10 14:03:33 2017 +0000
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Thu May 11 08:40:32 2017 -0700
@@ -207,30 +207,30 @@
   st->print(" STACK ");
   getrlimit(RLIMIT_STACK, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%luk", rlim.rlim_cur >> 10);
+  else st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_cur) >> 10);
 
   st->print(", CORE ");
   getrlimit(RLIMIT_CORE, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%luk", rlim.rlim_cur >> 10);
+  else st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_cur) >> 10);
 
   // Isn't there on solaris
 #if !defined(SOLARIS) && !defined(AIX)
   st->print(", NPROC ");
   getrlimit(RLIMIT_NPROC, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%lu", rlim.rlim_cur);
+  else st->print(UINT64_FORMAT, uint64_t(rlim.rlim_cur));
 #endif
 
   st->print(", NOFILE ");
   getrlimit(RLIMIT_NOFILE, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%lu", rlim.rlim_cur);
+  else st->print(UINT64_FORMAT, uint64_t(rlim.rlim_cur));
 
   st->print(", AS ");
   getrlimit(RLIMIT_AS, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%luk", rlim.rlim_cur >> 10);
+  else st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_cur) >> 10);
   st->cr();
 }