Lines Matching defs:shm
13 SM_RCSID("@(#)$Id: t-shm.c,v 1.22 2005/01/14 02:14:10 ca Exp $")
25 # include <sm/shm.h>
49 int *shm, shmid;
52 shm = (int *) sm_shmstart(T_SHMKEY, SHMSIZE, 0, &shmid, owner);
53 if (shm == (int *) 0)
64 *shm = 0;
67 ++*shm;
70 --*shm;
76 t = *shm;
79 ++*shm;
81 if (*shm != SHM_MAX + t)
83 *shm, SHM_MAX + t);
86 printf("shmval: %d\n", *shm);
94 return sm_shmstop((void *) shm, shmid, owner);
117 int *shm, shmid;
120 shm = (int *) sm_shmstart(T_SHMKEY, size, 0, &shmid, owner);
121 if (shm == (int *) 0)
128 shm[i] = i;
131 if (shm[i] != i)
133 fprintf(stderr, "failed at %d: %d", i, shm[i]);
137 return sm_shmstop((void *) shm, shmid, owner);
160 int *shm, shmid;
163 shm = (int *) sm_shmstart(T_SHMKEY, SHMSIZE, 0, &shmid, owner);
164 if (shm == (int *) 0)
176 *shm = 1;
177 while (*shm == 1 && cnt++ < MAX_CNT)
182 r = sm_shmstop((void *) shm, shmid, owner);
184 shm = (int *) sm_shmstart(T_SHMKEY, SHMSIZE, 0, &shmid, owner);
185 SM_TEST(shm != (int *) 0);
189 while (*shm != 1 && cnt++ < MAX_CNT)
192 *shm = 2;
197 return sm_shmstop((void *) shm, shmid, owner);