OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | diff --git a/Bonnie.c b/Bonnie.c |
| 2 | index 909ca4a..b3a782a 100644 |
| 3 | --- a/Bonnie.c |
| 4 | +++ b/Bonnie.c |
| 5 | @@ -77,11 +77,6 @@ |
| 6 | #include <sys/wait.h> |
| 7 | #include <stdlib.h> |
| 8 | |
| 9 | -#ifdef __linux__ |
| 10 | -/* for o_direct */ |
| 11 | -#include <asm/page.h> |
| 12 | -#endif |
| 13 | - |
| 14 | #ifdef unix |
| 15 | #include <signal.h> |
| 16 | #endif |
| 17 | @@ -197,13 +192,13 @@ int main( |
| 18 | int volcnt; |
| 19 | register off_t words; |
| 20 | |
| 21 | - __buf = malloc(Chunk + ~PAGE_MASK); |
| 22 | + __buf = malloc(Chunk + ~(sysconf(_SC_PAGE_SIZE)-1)); |
| 23 | if (!__buf) |
| 24 | { |
| 25 | - fprintf(stderr, "unable to malloc %d bytes\n", Chunk + ~PAGE_MASK); |
| 26 | + fprintf(stderr, "unable to malloc %d bytes\n", Chunk + ~(sysconf(_SC_PAGE_SIZE)-1)); |
| 27 | exit(1) ; |
| 28 | } |
| 29 | - buf = (int *)((unsigned long)(__buf + ~PAGE_MASK) & PAGE_MASK); |
| 30 | + buf = (int *)((unsigned long)(__buf + ~(sysconf(_SC_PAGE_SIZE)-1)) & sysconf(_SC_PAGE_SIZE)-1); |
| 31 | |
| 32 | basetime = (int) time((time_t *) NULL); |
| 33 | size = 100; |
| 34 |
