Commit f6cc277c authored by Laurent Dufour's avatar Laurent Dufour Committed by Pavel Emelyanov

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: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 67038451
......@@ -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++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment