return __iproute2_hz_internal;
}
+extern int __iproute2_user_hz_internal;
+extern int __get_user_hz(void);
+
+static __inline__ int get_user_hz(void)
+{
+ if (__iproute2_user_hz_internal == 0)
+ __iproute2_user_hz_internal = __get_user_hz();
+ return __iproute2_user_hz_internal;
+}
+
#endif /* __UTILS_H__ */
struct rta_cacheinfo *ci = RTA_DATA(tb[RTA_CACHEINFO]);
static int hz;
if (!hz)
- hz = get_hz();
+ hz = get_user_hz();
if (ci->rta_expires != 0)
fprintf(fp, " expires %dsec", ci->rta_expires/hz);
if (ci->rta_error != 0)
if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) {
static int hz;
if (!hz)
- hz = get_hz();
+ hz = get_user_hz();
if (r->rtm_flags & RTM_F_CLONED)
fprintf(fp, "%s cache ", _SL_);
if (ci->rta_expires)
if (i-2 < sizeof(mx_names)/sizeof(char*))
fprintf(fp, " %s", mx_names[i-2]);
else
- fprintf(fp, " metric%d", i);
+ fprintf(fp, " metric %d", i);
if (mxlock & (1<<i))
fprintf(fp, " lock");
return HZ;
}
+int __iproute2_user_hz_internal;
+
+int __get_user_hz(void)
+{
+ return sysconf(_SC_CLK_TCK);
+}
+
const char *rt_addr_n2a(int af, int len, const void *addr, char *buf, int buflen)
{
switch (af) {
void print_tm(FILE * f, const struct tcf_t *tm)
{
- int hz = get_hz();
+ int hz = get_user_hz();
if (tm->install != 0)
fprintf(f, " installed %u sec", (unsigned)(tm->install/hz));
if (tm->lastuse != 0)