mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
test/zdtm : shm-mp fix page size
Test should not assume that page size is 4096. The test was failing on ppc64 where page size is usually 64K. Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
67038451a9
commit
f6cc277cad
1 changed files with 4 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ int main(int argc, char **argv)
|
|||
goto out;
|
||||
}
|
||||
|
||||
id = shmget(key, 2 * 4096, 0777 | IPC_CREAT | IPC_EXCL);
|
||||
id = shmget(key, 2 * PAGE_SIZE, 0777 | IPC_CREAT | IPC_EXCL);
|
||||
if (id == -1) {
|
||||
pr_perror("Can't make seg");
|
||||
goto out;
|
||||
|
|
@ -86,9 +86,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
mem[0] = 'R';
|
||||
mem[4096] = 'W';
|
||||
mem[PAGE_SIZE] = 'W';
|
||||
|
||||
if (mprotect(mem, 4096, PROT_READ)) {
|
||||
if (mprotect(mem, PAGE_SIZE, PROT_READ)) {
|
||||
pr_perror("Can't mprotect shmem");
|
||||
goto out_dt;
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (check_prot(mem, 'R', PROT_READ))
|
||||
f++;
|
||||
if (check_prot(mem + 4096, 'W', PROT_READ | PROT_WRITE))
|
||||
if (check_prot(mem + PAGE_SIZE, 'W', PROT_READ | PROT_WRITE))
|
||||
f++;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue