diff options
author | Eric Andersen | 2000-06-26 10:45:52 +0000 |
---|---|---|
committer | Eric Andersen | 2000-06-26 10:45:52 +0000 |
commit | 10dc9d4d17e6880bfdfd253716ce72ec1243227f (patch) | |
tree | f3c2aa6ab3dadf1b4bf710c7957e72faddebd75f /internal.h | |
parent | 8a24a6783af7a0d54b1f2ebcda5b07757bd19c99 (diff) | |
download | busybox-10dc9d4d17e6880bfdfd253716ce72ec1243227f.zip busybox-10dc9d4d17e6880bfdfd253716ce72ec1243227f.tar.gz |
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 'internal.h')
-rw-r--r-- | internal.h | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -30,6 +30,7 @@ #include <stdarg.h> #include <string.h> #include <unistd.h> +#include <errno.h> #include <sys/stat.h> #include <sys/param.h> #include <mntent.h> @@ -296,9 +297,27 @@ int nfsmount(const char *spec, const char *node, unsigned long *flags, #define RB_POWER_OFF 0x4321fedc #endif +/* Include our own copy of struct sysinfo to avoid binary compatability + * problems with Linux 2.4, which changed things. Grumble, grumble. */ +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ +}; +extern int sysinfo (struct sysinfo* info); -#ifndef setbit /* Bit map related macros -- libc5 doens't provide these... sigh. */ +#ifndef setbit #define NBBY CHAR_BIT #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) |