We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ce1e3e commit 42610b7Copy full SHA for 42610b7
timectxswws.c
@@ -54,11 +54,11 @@ int main(int argc, char** argv) {
54
free(buf);
55
}
56
57
- const int shm_id = shmget(IPC_PRIVATE, sizeof (int) + ws_pages * 4096,
+ const int shm_id = shmget(IPC_PRIVATE, (ws_pages + 1) * 4096,
58
IPC_CREAT | 0666);
59
const pid_t other = fork();
60
int* futex = shmat(shm_id, NULL, 0);
61
- void* ws = futex + 1;
+ void* ws = ((char *) futex) + 4096;
62
*futex = 0xA;
63
if (other == 0) {
64
for (int i = 0; i < iterations; i++) {
0 commit comments