aboutsummaryrefslogtreecommitdiff
path: root/uptime.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-06-26 10:45:52 +0000
committerEric Andersen <andersen@codepoet.org>2000-06-26 10:45:52 +0000
commit10dc9d4d17e6880bfdfd253716ce72ec1243227f (patch)
treef3c2aa6ab3dadf1b4bf710c7957e72faddebd75f /uptime.c
parent8a24a6783af7a0d54b1f2ebcda5b07757bd19c99 (diff)
downloadbusybox-w32-10dc9d4d17e6880bfdfd253716ce72ec1243227f.tar.gz
busybox-w32-10dc9d4d17e6880bfdfd253716ce72ec1243227f.tar.bz2
busybox-w32-10dc9d4d17e6880bfdfd253716ce72ec1243227f.zip
Updates to handle Linux 2.4.0 kernels (kludged around the "none" entries in
/proc/mounts, added a hack to make sysinfo work with both old and new kernels). -Erik
Diffstat (limited to 'uptime.c')
-rw-r--r--uptime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/uptime.c b/uptime.c
index 67ca34d75..efdbccf00 100644
--- a/uptime.c
+++ b/uptime.c
@@ -31,13 +31,14 @@
31#include "internal.h" 31#include "internal.h"
32#include <stdio.h> 32#include <stdio.h>
33#include <time.h> 33#include <time.h>
34#include <sys/sysinfo.h> 34#include <errno.h>
35 35
36#define FSHIFT 16 /* nr of bits of precision */ 36#define FSHIFT 16 /* nr of bits of precision */
37#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ 37#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
38#define LOAD_INT(x) ((x) >> FSHIFT) 38#define LOAD_INT(x) ((x) >> FSHIFT)
39#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) 39#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
40 40
41
41extern int uptime_main(int argc, char **argv) 42extern int uptime_main(int argc, char **argv)
42{ 43{
43 int updays, uphours, upminutes; 44 int updays, uphours, upminutes;