summaryrefslogtreecommitdiffstats
path: root/lib/utils.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2010-11-17 10:55:42 (GMT)
committerThomas Graf <tgraf@suug.ch>2010-11-17 10:55:42 (GMT)
commit10424b20c1f29175fce07d0bf7639f2cc324ad78 (patch)
tree6e87adbac88895480837a84ef197919e89c8e605 /lib/utils.c
parent3a9562001c91a8b876b8ff8e26bafc9f86fbad23 (diff)
downloadlibnl-10424b20c1f29175fce07d0bf7639f2cc324ad78.zip
libnl-10424b20c1f29175fce07d0bf7639f2cc324ad78.tar.gz
libnl-10424b20c1f29175fce07d0bf7639f2cc324ad78.tar.bz2
Rename nl_get_hz() to nl_get_user_hz() to indicate it's not the in-kernel HZ value
Diffstat (limited to 'lib/utils.c')
-rw-r--r--lib/utils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/utils.c b/lib/utils.c
index 56a92bf..1168293 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -313,11 +313,15 @@ static void __init get_psched_settings(void)
strncpy(name, "/proc/net/psched", sizeof(name) - 1);
if ((fd = fopen(name, "r"))) {
- uint32_t tick, us;
+ uint32_t ns_per_usec, ns_per_tick;
/* the file contains 4 hexadecimals, but we just use
the first two of them */
- fscanf(fd, "%08x %08x", &tick, &us);
- ticks_per_usec = (double)tick/(double)us;
+ fscanf(fd, "%08x %08x", &ns_per_usec, &ns_per_tick);
+
+ ticks_per_usec = (double) ns_per_usec /
+ (double) ns_per_tick;
+
+
fclose(fd);
}
}
@@ -327,7 +331,7 @@ static void __init get_psched_settings(void)
/**
* Return the value of HZ
*/
-int nl_get_hz(void)
+int nl_get_user_hz(void)
{
return user_hz;
}