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:
Laurent Dufour 2016-06-09 18:59:00 +03:00 committed by Pavel Emelyanov
parent 67038451a9
commit f6cc277cad

View file

@ -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++;