+/* some systems don't take the 2nd argument */
+int sys_gettimeofday(struct timeval *tv)
+{
+#ifdef HAVE_GETTIMEOFDAY_TZ
+ return gettimeofday(tv, NULL);
+#else
+ return gettimeofday(tv);
+#endif
+}
+
+#define HUMANIFY(mult) \
+ do { \
+ if (num >= mult || num <= -mult) { \
+ double dnum = (double)num / mult; \
+ char units; \
+ if (num < 0) \
+ dnum = -dnum; \
+ if (dnum < mult) \
+ units = 'K'; \
+ else if ((dnum /= mult) < mult) \
+ units = 'M'; \
+ else if ((dnum /= mult) < mult) \
+ units = 'G'; \
+ else { \
+ dnum /= mult; \
+ units = 'T'; \
+ } \
+ if (num < 0) \
+ dnum = -dnum; \
+ snprintf(bufs[n], sizeof bufs[0], "%.2f%c", dnum, units); \
+ return bufs[n]; \
+ } \
+ } while (0)
+
+/* Return the int64 number as a string. If the human_flag arg is non-zero,
+ * we may output the number in K, M, G, or T units. If we don't add a unit
+ * suffix, we will append the fract string, if it is non-NULL. We can
+ * return up to 4 buffers at a time. */
+char *do_big_num(int64 num, int human_flag, const char *fract)