mirror of
https://github.com/clearlinux/graphene.git
synced 2026-08-27 03:08:05 +00:00
Merge branch 'master' of https://github.com/oscarlab/graphene
This commit is contained in:
@@ -12,6 +12,7 @@ regression.add_check(name="Ftruncate",
|
||||
check=lambda res: "large-mmap: ftruncate OK" in res[0].out)
|
||||
|
||||
regression.add_check(name="Large mmap",
|
||||
check=lambda res: "large-mmap: test completed OK" in res[0].out)
|
||||
check=lambda res: "large-mmap: mmap 1 completed OK" in res[0].out and \
|
||||
"large-mmap: mmap 2 completed OK" in res[0].out)
|
||||
|
||||
regression.run_checks()
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#define TEST_LENGTH 0x10000f000
|
||||
#define TEST_LENGTH2 0x8000f000
|
||||
|
||||
int main() {
|
||||
FILE*fp=fopen("testfil","a+");
|
||||
@@ -16,9 +17,19 @@ int main() {
|
||||
else
|
||||
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; }
|
||||
((char*)a)[0x100000000]=0xff;
|
||||
printf("large-mmap: test completed OK\n");
|
||||
printf("large-mmap: mmap 2 completed OK\n");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user