4 * Copyright (C) 1992 Darren Senn
7 /* This implements the sysinfo() system call */
10 #include <linux/unistd.h>
11 #include <linux/swap.h>
12 #include <linux/smp_lock.h>
14 #include <asm/uaccess.h>
16 asmlinkage
long sys_sysinfo(struct sysinfo
*info
)
20 memset((char *)&val
, 0, sizeof(struct sysinfo
));
23 val
.uptime
= jiffies
/ HZ
;
25 val
.loads
[0] = avenrun
[0] << (SI_LOAD_SHIFT
- FSHIFT
);
26 val
.loads
[1] = avenrun
[1] << (SI_LOAD_SHIFT
- FSHIFT
);
27 val
.loads
[2] = avenrun
[2] << (SI_LOAD_SHIFT
- FSHIFT
);
29 val
.procs
= nr_threads
-1;
35 if (copy_to_user(info
, &val
, sizeof(struct sysinfo
)))