4 * Copyright (C) 1992 Darren Senn
7 /* This implements the sysinfo() system call */
9 #include <linux/sched.h>
10 #include <linux/string.h>
11 #include <linux/unistd.h>
12 #include <linux/types.h>
14 #include <linux/swap.h>
15 #include <linux/smp.h>
16 #include <linux/smp_lock.h>
18 #include <asm/uaccess.h>
20 asmlinkage
int sys_sysinfo(struct sysinfo
*info
)
24 memset((char *)&val
, 0, sizeof(struct sysinfo
));
27 val
.uptime
= jiffies
/ HZ
;
29 val
.loads
[0] = avenrun
[0] << (SI_LOAD_SHIFT
- FSHIFT
);
30 val
.loads
[1] = avenrun
[1] << (SI_LOAD_SHIFT
- FSHIFT
);
31 val
.loads
[2] = avenrun
[2] << (SI_LOAD_SHIFT
- FSHIFT
);
33 val
.procs
= nr_tasks
-1;
39 if (copy_to_user(info
, &val
, sizeof(struct sysinfo
)))