Home
last modified time | relevance | path

Searched refs:shm_id (Results 1 – 25 of 49) sorted by relevance

12

/external/ltp/testcases/kernel/syscalls/ipc/shmget/
Dshmget06.c28 static int shm_id[2], pid; variable
33 SAFE_FILE_PRINTF(NEXT_ID_PATH, "%d", shm_id[0]); in verify_shmget()
35 shm_id[1] = SAFE_SHMGET(shmkey[1], SHM_SIZE, IPC_CREAT | SHM_RW); in verify_shmget()
36 if (shm_id[1] == shm_id[0]) in verify_shmget()
38 " same shm id unexpectedly", shm_id[0]); in verify_shmget()
41 " new shm id %d", shm_id[0], shm_id[1]); in verify_shmget()
43 SAFE_SHMCTL(shm_id[1], IPC_RMID, NULL); in verify_shmget()
52 shm_id[0] = SAFE_SHMGET(shmkey[0], SHM_SIZE, IPC_CREAT | SHM_RW); in setup()
60 if (shm_id[i] != -1) in cleanup()
61 SAFE_SHMCTL(shm_id[i], IPC_RMID, NULL); in cleanup()
Dshmget05.c29 static int shm_id, pid; variable
36 shm_id = SAFE_SHMGET(shmkey, SHM_SIZE, SHM_RW | IPC_CREAT); in verify_shmget()
37 if (shm_id == pid) in verify_shmget()
40 tst_res(TFAIL, "shm_next_id failed, expected id %d, but got %d", pid, shm_id); in verify_shmget()
43 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in verify_shmget()
55 if (shm_id != -1) in cleanup()
56 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
Dshmget04.c27 static int shm_id = -1; variable
55 shm_id = SAFE_SHMGET(shmkey, SHM_SIZE, IPC_CREAT | IPC_EXCL); in setup()
60 if (shm_id >= 0) in cleanup()
61 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
/external/ltp/testcases/kernel/syscalls/ipc/shmctl/
Dshmctl07.c20 static int shm_id = -1; variable
26 TEST(shmctl(shm_id, SHM_LOCK, NULL)); in verify_shmlock()
29 tst_res(TFAIL | TTERRNO, "shmctl(%i, SHM_LOCK, NULL)", shm_id); in verify_shmlock()
31 tst_res(TPASS, "shmctl(%i, SHM_LOCK, NULL)", shm_id); in verify_shmlock()
34 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in verify_shmlock()
41 TEST(shmctl(shm_id, SHM_UNLOCK, NULL)); in verify_shmlock()
44 tst_res(TFAIL | TTERRNO, "shmctl(%i, SHM_UNLOCK, NULL)", shm_id); in verify_shmlock()
46 tst_res(TPASS, "shmctl(%i, SHM_UNLOCK, NULL)", shm_id); in verify_shmlock()
48 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in verify_shmlock()
58 shm_id = SAFE_SHMGET(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | SHM_RW); in setup()
[all …]
Dshmctl08.c23 static int shm_id = -1; variable
27 TEST(shmctl(shm_id, IPC_SET, ds)); in test_ipc_set()
30 tst_res(TFAIL, "shmctl(%i, IPC_SET, ...)", shm_id); in test_ipc_set()
35 shm_id, ds->shm_perm.mode); in test_ipc_set()
56 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in verify_shmset()
71 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in verify_shmset()
87 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in verify_shmset()
93 shm_id = SAFE_SHMGET(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0666); in setup()
98 if (shm_id >= 0) in cleanup()
99 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
Dshmctl01.c31 static int shm_id; variable
41 addr = SAFE_SHMAT(shm_id, NULL, 0); in attach_child()
106 SAFE_SHMCTL(shm_id, IPC_STAT, &ds1); in check_nattch()
147 addr = SAFE_SHMAT(shm_id, NULL, 0); in verify_shmstat_inherit()
199 SAFE_SHMCTL(shm_id, IPC_STAT, &ds); in shmstat_basic_check()
229 static int get_shm_idx_from_id(int shm_id) in get_shm_idx_from_id() argument
235 max_idx = SAFE_SHMCTL(shm_id, SHM_INFO, (void *)&dummy); in get_shm_idx_from_id()
238 if (shmctl(i, SHM_STAT, &dummy_ds) == shm_id) in get_shm_idx_from_id()
248 shm_id = SAFE_SHMGET(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | SHM_RW); in setup()
251 shm_idx = get_shm_idx_from_id(shm_id); in setup()
[all …]
/external/ltp/testcases/kernel/syscalls/ipc/shmdt/
Dshmdt01.c21 static int shm_id = -1, shm_key, pass; variable
35 SAFE_SHMCTL(shm_id, IPC_STAT, &buf); in check_functionality()
54 shared = SAFE_SHMAT(shm_id, 0, 0); in verify_shmdt()
63 shm_id = SAFE_SHMGET(shm_key, INT_SIZE, SHM_RW | IPC_CREAT | IPC_EXCL); in setup()
66 shared = SAFE_SHMAT(shm_id, 0, 0); in setup()
71 if (shm_id != -1) in cleanup()
72 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
/external/ltp/testcases/kernel/mem/mtest07/
Dshm_test.c134 static int rm_shared_mem(key_t shm_id, /* id of shared memory segment to be removed */ in rm_shared_mem() argument
141 getpid(), shm_id, shm_addr, cmd); in rm_shared_mem()
142 if (shmctl(shm_id, IPC_RMID, (struct shmid_ds *)shmbuf) == -1) { in rm_shared_mem()
143 dprt("pid[%d]: rm_shared_mem(): shmctl unable to remove shm_id[%d]\n", getpid(), shm_id); in rm_shared_mem()
181 key_t shm_id = 0; /* shared memory id */ in shmat_rd_wr() local
194 if ((shm_id = in shmat_rd_wr()
204 "success got segment id %d\n", getpid(), shm_id); in shmat_rd_wr()
207 if ((shmat_addr = shmat(shm_id, NULL, 0)) == (void *)-1) { in shmat_rd_wr()
208 rm_shared_mem(shm_id, shmat_addr, 0); in shmat_rd_wr()
247 if (rm_shared_mem(shm_id, shmat_addr, 1) == -1) { in shmat_rd_wr()
/external/ltp/testcases/kernel/syscalls/ipc/shmat/
Dshmat03.c46 static int shm_id; variable
51 shm_id = SAFE_SHMGET(IPC_PRIVATE, getpagesize(), 0777); in setup()
59 if (shm_id) in cleanup()
60 SAFE_SHMCTL(shm_id, IPC_RMID, 0); in cleanup()
70 shm_addr = shmat(shm_id, ((void *)1), SHM_RND | SHM_REMAP); in run()
Dshmat01.c33 static int shm_id = -1; variable
90 addr = shmat(shm_id, *tc->shmaddr, tc->flag); in verify_shmat()
96 SAFE_SHMCTL(shm_id, IPC_STAT, &buf); in verify_shmat()
137 shm_id = SAFE_SHMGET(shm_key, INT_SIZE, SHM_RW | IPC_CREAT | IPC_EXCL); in setup()
142 if (shm_id != -1) in cleanup()
143 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
/external/linux-kselftest/tools/testing/selftests/powerpc/ptrace/
Dptrace-gpr.c12 int shm_id; variable
24 cptr = (int *)shmat(shm_id, NULL, 0); in gpr()
77 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_gpr()
87 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_gpr()
95 shmctl(shm_id, IPC_RMID, NULL); in ptrace_gpr()
103 shmctl(shm_id, IPC_RMID, NULL); in ptrace_gpr()
Dptrace-vsx.c11 int shm_id; variable
22 cptr = (int *)shmat(shm_id, NULL, 0); in vsx()
66 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_vsx()
84 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_vsx()
92 shmctl(shm_id, IPC_RMID, NULL); in ptrace_vsx()
100 shmctl(shm_id, IPC_RMID, NULL); in ptrace_vsx()
Dptrace-tm-tar.c11 int shm_id; variable
21 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_tar()
121 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_tar()
126 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_tar()
136 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_tar()
142 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_tar()
Dptrace-tm-spd-gpr.c12 int shm_id; variable
33 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_gpr()
123 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_gpr()
134 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_gpr()
144 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_gpr()
151 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_gpr()
Dptrace-tm-spr.c17 int shm_id; variable
37 cptr = (struct shared *)shmat(shm_id, NULL, 0); in tm_spr()
118 shm_id = shmget(IPC_PRIVATE, sizeof(struct shared), 0777|IPC_CREAT); in ptrace_tm_spr()
130 pptr = (struct shared *)shmat(shm_id, NULL, 0); in ptrace_tm_spr()
140 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spr()
148 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spr()
Dptrace-tm-spd-tar.c11 int shm_id; variable
27 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_tar()
133 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_tar()
138 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_tar()
149 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_tar()
156 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_tar()
Dptrace-tm-vsx.c11 int shm_id; variable
34 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_vsx()
117 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_vsx()
135 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_vsx()
143 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_vsx()
149 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_vsx()
Dptrace-tm-spd-vsx.c11 int shm_id; variable
47 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_vsx()
133 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_vsx()
152 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_vsx()
160 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_vsx()
166 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_vsx()
Dptrace-tar.c11 int shm_id; variable
20 cptr = (int *)shmat(shm_id, NULL, 0); in tar()
84 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tar()
95 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tar()
119 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tar()
Dptrace-tm-gpr.c12 int shm_id; variable
26 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_gpr()
117 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_gpr()
127 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_gpr()
140 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_gpr()
/external/ltp/testcases/kernel/syscalls/kill/
Dkill05.c31 static int shm_id = -1; variable
90 shm_id = SAFE_SHMGET(shm_key, getpagesize(), 0666 | IPC_CREAT); in setup()
91 flag = SAFE_SHMAT(shm_id, 0, 0); in setup()
97 if (shm_id != -1) in cleanup()
98 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/
D9-1.c110 int *child_pid, oldcount, newcount, shm_id, i; in main() local
129 shm_id = shmget(key, sizeof(int), IPC_CREAT | 0600); in main()
130 if (shm_id < 0) { in main()
135 shmptr = shmat(shm_id, 0, 0); in main()
192 SAFE_FUNC(shmctl(shm_id, IPC_RMID, NULL)); in main()
204 SAFE_FUNC(shmctl(shm_id, IPC_RMID, NULL)); in main()
/external/AFLplusplus/src/
Dafl-sharedmem.c131 shmctl(shm->shm_id, IPC_RMID, NULL); in afl_shm_deinit()
279 shm->shm_id = in afl_shm_init()
282 if (shm->shm_id < 0) { in afl_shm_init()
295 shmctl(shm->shm_id, IPC_RMID, NULL); // do not leak shmem in afl_shm_init()
304 shm_str = alloc_printf("%d", shm->shm_id); in afl_shm_init()
327 shm->map = shmat(shm->shm_id, NULL, 0); in afl_shm_init()
331 shmctl(shm->shm_id, IPC_RMID, NULL); // do not leak shmem in afl_shm_init()
349 shmctl(shm->shm_id, IPC_RMID, NULL); // do not leak shmem in afl_shm_init()
/external/ltp/libs/libltpnewipc/
Dlibnewipc.c74 int shm_id = -1; in probe_free_addr() local
79 shm_id = safe_shmget(file, lineno, probe_key, SHMLBA * 2, in probe_free_addr()
81 addr = safe_shmat(file, lineno, shm_id, NULL, 0); in probe_free_addr()
83 safe_shmctl(file, lineno, shm_id, IPC_RMID, NULL); in probe_free_addr()
/external/ltp/testcases/kernel/mem/hugetlb/lib/
Dhugetlb.c100 void rm_shm(int shm_id) in rm_shm() argument
102 if (shm_id == -1) in rm_shm()
108 if (shmctl(shm_id, IPC_RMID, NULL) == -1) { in rm_shm()
111 tst_res(TINFO, "id = %d", shm_id); in rm_shm()

12