|
@@ -7,6 +7,7 @@
|
|
#include <sys/types.h>
|
|
#include <sys/types.h>
|
|
|
|
|
|
#define TEST_LENGTH 0x10000f000
|
|
#define TEST_LENGTH 0x10000f000
|
|
|
|
+#define TEST_LENGTH2 0x8000f000
|
|
|
|
|
|
int main() {
|
|
int main() {
|
|
FILE*fp=fopen("testfil","a+");
|
|
FILE*fp=fopen("testfil","a+");
|
|
@@ -16,9 +17,19 @@ int main() {
|
|
else
|
|
else
|
|
printf("large-mmap: ftruncate OK\n");
|
|
printf("large-mmap: ftruncate OK\n");
|
|
|
|
|
|
- void* a=mmap(NULL, TEST_LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(fp), 0);
|
|
+ void* a=mmap(NULL, TEST_LENGTH2, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(fp), 0);
|
|
|
|
+ if (!a) { perror("mmap"); return 1; }
|
|
|
|
+ ((char*)a)[0x80000000]=0xff;
|
|
|
|
+ printf("large-mmap: mmap 1 completed OK\n");
|
|
|
|
+
|
|
|
|
+ rv = munmap(a, TEST_LENGTH2);
|
|
|
|
+ if (rv) { perror("mumap"); return 1; }
|
|
|
|
+
|
|
|
|
+ a=mmap(NULL, TEST_LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(fp), 0);
|
|
if (!a) { perror("mmap"); return 1; }
|
|
if (!a) { perror("mmap"); return 1; }
|
|
((char*)a)[0x100000000]=0xff;
|
|
((char*)a)[0x100000000]=0xff;
|
|
- printf("large-mmap: test completed OK\n");
|
|
+ printf("large-mmap: mmap 2 completed OK\n");
|
|
|
|
+
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|