diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-26 10:45:52 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-26 10:45:52 +0000 |
commit | 79e4e178ae733f43f6f6b914abe9c9f6c7b54ee6 (patch) | |
tree | f3c2aa6ab3dadf1b4bf710c7957e72faddebd75f /internal.h | |
parent | 073e4a817c3e656f3bf46b3b8e0c874c2cffbe5d (diff) | |
download | busybox-w32-79e4e178ae733f43f6f6b914abe9c9f6c7b54ee6.tar.gz busybox-w32-79e4e178ae733f43f6f6b914abe9c9f6c7b54ee6.tar.bz2 busybox-w32-79e4e178ae733f43f6f6b914abe9c9f6c7b54ee6.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
git-svn-id: svn://busybox.net/trunk/busybox@701 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/internal.h b/internal.h index 127460fc6..c39dfde62 100644 --- a/internal.h +++ b/internal.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <stdarg.h> | 30 | #include <stdarg.h> |
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include <errno.h> | ||
33 | #include <sys/stat.h> | 34 | #include <sys/stat.h> |
34 | #include <sys/param.h> | 35 | #include <sys/param.h> |
35 | #include <mntent.h> | 36 | #include <mntent.h> |
@@ -296,9 +297,27 @@ int nfsmount(const char *spec, const char *node, unsigned long *flags, | |||
296 | #define RB_POWER_OFF 0x4321fedc | 297 | #define RB_POWER_OFF 0x4321fedc |
297 | #endif | 298 | #endif |
298 | 299 | ||
300 | /* Include our own copy of struct sysinfo to avoid binary compatability | ||
301 | * problems with Linux 2.4, which changed things. Grumble, grumble. */ | ||
302 | struct sysinfo { | ||
303 | long uptime; /* Seconds since boot */ | ||
304 | unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ | ||
305 | unsigned long totalram; /* Total usable main memory size */ | ||
306 | unsigned long freeram; /* Available memory size */ | ||
307 | unsigned long sharedram; /* Amount of shared memory */ | ||
308 | unsigned long bufferram; /* Memory used by buffers */ | ||
309 | unsigned long totalswap; /* Total swap space size */ | ||
310 | unsigned long freeswap; /* swap space still available */ | ||
311 | unsigned short procs; /* Number of current processes */ | ||
312 | unsigned long totalhigh; /* Total high memory size */ | ||
313 | unsigned long freehigh; /* Available high memory size */ | ||
314 | unsigned int mem_unit; /* Memory unit size in bytes */ | ||
315 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | ||
316 | }; | ||
317 | extern int sysinfo (struct sysinfo* info); | ||
299 | 318 | ||
300 | #ifndef setbit | ||
301 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ | 319 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ |
320 | #ifndef setbit | ||
302 | #define NBBY CHAR_BIT | 321 | #define NBBY CHAR_BIT |
303 | #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) | 322 | #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) |
304 | #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) | 323 | #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) |