Home
last modified time | relevance | path

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

/external/ltp/testcases/kernel/mem/mtest07/
Dshm_test.c126 static int rm_shared_mem(key_t shm_id, /* id of shared memory segment to be removed */ in rm_shared_mem() argument
133 getpid(), shm_id, shm_addr, cmd); in rm_shared_mem()
134 if (shmctl(shm_id, IPC_RMID, (struct shmid_ds *)shmbuf) == -1) { in rm_shared_mem()
135 dprt("pid[%d]: rm_shared_mem(): shmctl unable to remove shm_id[%d]\n", getpid(), shm_id); in rm_shared_mem()
174 key_t shm_id = 0; /* shared memory id */ in shmat_rd_wr() local
189 if ((shm_id = in shmat_rd_wr()
199 "success got segment id %d\n", getpid(), shm_id); in shmat_rd_wr()
202 if ((shmat_addr = shmat(shm_id, NULL, 0)) == (void *)-1) { in shmat_rd_wr()
203 rm_shared_mem(shm_id, shmat_addr, 0); in shmat_rd_wr()
242 if (rm_shared_mem(shm_id, shmat_addr, 1) == -1) { in shmat_rd_wr()
/external/ltp/testcases/kernel/syscalls/ipc/shmat/
Dshmat03.c56 static int shm_id; variable
61 shm_id = SAFE_SHMGET(IPC_PRIVATE, getpagesize(), 0777); in setup()
69 if (shm_id) in cleanup()
70 SAFE_SHMCTL(shm_id, IPC_RMID, 0); in cleanup()
80 shm_addr = shmat(shm_id, ((void *)1), SHM_RND | SHM_REMAP); in run()
Dshmat01.c46 static int shm_id = -1; variable
113 addr = shmat(shm_id, *tc->shmaddr, tc->flag); in verify_shmat()
119 SAFE_SHMCTL(shm_id, IPC_STAT, &buf); in verify_shmat()
160 shm_id = SAFE_SHMGET(shm_key, INT_SIZE, SHM_RW | IPC_CREAT | IPC_EXCL); in setup()
165 if (shm_id != -1) in cleanup()
166 SAFE_SHMCTL(shm_id, IPC_RMID, NULL); in cleanup()
/external/linux-kselftest/tools/testing/selftests/powerpc/ptrace/
Dptrace-gpr.c16 int shm_id; variable
28 cptr = (int *)shmat(shm_id, NULL, 0); in gpr()
81 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_gpr()
91 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_gpr()
99 shmctl(shm_id, IPC_RMID, NULL); in ptrace_gpr()
107 shmctl(shm_id, IPC_RMID, NULL); in ptrace_gpr()
Dptrace-vsx.c15 int shm_id; variable
26 cptr = (int *)shmat(shm_id, NULL, 0); in vsx()
68 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_vsx()
86 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_vsx()
94 shmctl(shm_id, IPC_RMID, NULL); in ptrace_vsx()
102 shmctl(shm_id, IPC_RMID, NULL); in ptrace_vsx()
Dptrace-tm-tar.c15 int shm_id; variable
25 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_tar()
124 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_tar()
129 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_tar()
139 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_tar()
145 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_tar()
Dptrace-tm-spd-tar.c15 int shm_id; variable
31 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_tar()
136 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_tar()
141 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_tar()
152 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_tar()
159 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_tar()
Dptrace-tm-spd-gpr.c16 int shm_id; variable
37 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_gpr()
126 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_gpr()
137 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_gpr()
147 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_gpr()
154 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_gpr()
Dptrace-tm-spr.c21 int shm_id; variable
41 cptr = (struct shared *)shmat(shm_id, NULL, 0); in tm_spr()
121 shm_id = shmget(IPC_PRIVATE, sizeof(struct shared), 0777|IPC_CREAT); in ptrace_tm_spr()
133 pptr = (struct shared *)shmat(shm_id, NULL, 0); in ptrace_tm_spr()
143 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spr()
151 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spr()
Dptrace-tm-vsx.c15 int shm_id; variable
38 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_vsx()
121 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_vsx()
139 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_vsx()
147 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_vsx()
153 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_vsx()
Dptrace-tm-spd-vsx.c15 int shm_id; variable
51 cptr = (int *)shmat(shm_id, NULL, 0); in tm_spd_vsx()
137 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tm_spd_vsx()
156 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tm_spd_vsx()
164 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_vsx()
170 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_spd_vsx()
Dptrace-tar.c15 int shm_id; variable
24 cptr = (int *)shmat(shm_id, NULL, 0); in tar()
85 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 3, 0777|IPC_CREAT); in ptrace_tar()
96 pptr = (int *)shmat(shm_id, NULL, 0); in ptrace_tar()
120 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tar()
Dptrace-tm-gpr.c16 int shm_id; variable
30 cptr = (unsigned long *)shmat(shm_id, NULL, 0); in tm_gpr()
120 shm_id = shmget(IPC_PRIVATE, sizeof(int) * 2, 0777|IPC_CREAT); in ptrace_tm_gpr()
130 pptr = (unsigned long *)shmat(shm_id, NULL, 0); in ptrace_tm_gpr()
143 shmctl(shm_id, IPC_RMID, NULL); in ptrace_tm_gpr()
Dptrace-pkey.c298 int shm_id; in ptrace_pkey() local
302 shm_id = shmget(IPC_PRIVATE, sizeof(*info), 0777 | IPC_CREAT); in ptrace_pkey()
303 info = shmat(shm_id, NULL, 0); in ptrace_pkey()
322 shmctl(shm_id, IPC_RMID, NULL); in ptrace_pkey()
Dcore-pkey.c423 int shm_id; in core_pkey() local
431 shm_id = shmget(IPC_PRIVATE, sizeof(*info), 0777 | IPC_CREAT); in core_pkey()
432 info = shmat(shm_id, NULL, 0); in core_pkey()
451 shmctl(shm_id, IPC_RMID, NULL); in core_pkey()
/external/ltp/testcases/kernel/syscalls/ipc/libnewipc/
Dlibnewipc.c88 int shm_id = -1; in probe_free_addr() local
93 shm_id = shmget(probe_key, SHMLBA * 2, SHM_RW | IPC_CREAT | IPC_EXCL); in probe_free_addr()
94 if (shm_id == -1) in probe_free_addr()
97 addr = shmat(shm_id, NULL, 0); in probe_free_addr()
104 if (shmctl(shm_id, IPC_RMID, NULL) == -1) in probe_free_addr()
/external/autotest/client/tests/synctest/src/
Dsynctest.c31 int shm_id; in main() local
53 shm_id = shmget(IPC_PRIVATE, 10, IPC_CREAT | IPC_EXCL | 0600); in main()
54 if (shm_id == -1) { in main()
60 shm_addr = shmat(shm_id, NULL, 0); in main()
153 if (shmctl(shm_id, IPC_RMID, &shm_desc) == -1) { in main()
/external/ltp/testcases/kernel/mem/hugetlb/lib/
Dhugetlb.c115 void rm_shm(int shm_id) in rm_shm() argument
117 if (shm_id == -1) in rm_shm()
123 if (shmctl(shm_id, IPC_RMID, NULL) == -1) { in rm_shm()
126 tst_res(TINFO, "id = %d", shm_id); in rm_shm()
Dhugetlb.h54 void rm_shm(int shm_id);
/external/ltp/testcases/kernel/syscalls/ipc/lib/
Dlibipc.c157 void rm_shm(int shm_id) in rm_shm() argument
159 if (shm_id == -1) { /* no segment to remove */ in rm_shm()
167 if (shmctl(shm_id, IPC_RMID, NULL) == -1) { in rm_shm()
170 tst_resm(TINFO, "id = %d", shm_id); in rm_shm()
Dipcshm.h49 void rm_shm(int shm_id);
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/
D9-1.c109 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()
/external/autotest/client/tests/aiostress/
Daio-stress.c105 int shm_id; variable
910 ret = shmctl(shm_id, IPC_RMID, &ds);
1009 shm_id = shmget(IPC_PRIVATE, total_ram, IPC_CREAT | 0700);
1010 if (shm_id < 0) {
1015 p = shmat(shm_id, (char *)0x50000000, 0);
1034 shm_id = fd;
/external/ltp/testcases/kernel/io/ltp-aiodio/
Daio-stress.c106 int shm_id; variable
930 ret = shmctl(shm_id, IPC_RMID, &ds);
1029 shm_id = shmget(IPC_PRIVATE, total_ram, IPC_CREAT | 0700);
1030 if (shm_id < 0) {
1035 p = shmat(shm_id, (char *)0x50000000, 0);
1054 shm_id = fd;