Lines Matching refs:shm
36 #include <sys/shm.h>
44 char *shm;
52 shm = shmat(ipc_id, NULL, 0);
53 if (shm == (void *)-1) {
59 shmdt(shm);
69 shmdt(shm);
76 strcpy(shm, "hello");
82 strcpy(shm, "bye");
91 if (strcmp(shm, "bye") != 0) {
121 char *shm;
123 shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
124 if (shm == MAP_FAILED) {
128 strcpy(shm, "hello");
134 strcpy(shm, "bye");
143 if (strcmp(shm, "bye") != 0) {
171 char *shm;
178 shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
179 if (shm == MAP_FAILED) {
183 strcpy(shm, "hello");
189 strcpy(shm, "bye");
198 if (strcmp(shm, "bye") != 0) {
228 char *shm;
231 sprintf(tmpname,"test.shm.%dXXXXXX", getpid());
245 shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
246 if (shm == MAP_FAILED) {
252 strcpy(shm, "hello");
258 strcpy(shm, "bye");
267 if (strcmp(shm, "bye") != 0) {
297 char *shm;
300 sprintf(tmpname,"test.shm.%dXXXXXX", getpid());
314 shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
315 if (shm == MAP_FAILED) {
321 strcpy(shm, "hello");
327 strcpy(shm, "bye");
336 if (strcmp(shm, "bye") != 0) {