/external/ltp/testcases/kernel/mem/shmt/ |
D | shmt09.c | 75 int shmid; in main() local 94 if ((shmid = shmget(key, 10 * K_1, IPC_CREAT | 0666)) < 0) { in main() 99 shmid, errno); in main() 102 c1 = shmat(shmid, NULL, 0); in main() 107 shmid, errno); in main() 108 rm_shm(shmid); in main() 119 rm_shm(shmid); in main() 123 c2 = shmat(shmid, vp, 0); in main() 127 "att_addr = %p", shmid, c2, vp); in main() 128 rm_shm(shmid); in main() [all …]
|
D | shmt06.c | 68 int pid, pid1, shmid; in main() local 87 if ((shmid = shmget(key, SIZE, IPC_CREAT | 0666)) < 0) { in main() 90 shmid, errno); in main() 96 cp = shmat(shmid, NULL, 0); in main() 102 shmid, errno); in main() 110 rm_shm(shmid); in main() 140 rm_shm(shmid); in main() 146 int shmid, chld_pid; in child() local 153 if ((shmid = shmget(key, SIZE, 0)) < 0) { in child() 157 errno, shmid, chld_pid); in child() [all …]
|
D | shmt04.c | 69 int pid, pid1, shmid; in main() local 88 if ((shmid = shmget(key, SIZE, IPC_CREAT | 0666)) < 0) { in main() 91 shmid, errno); in main() 97 cp = shmat(shmid, NULL, 0); in main() 103 shmid, errno); in main() 111 rm_shm(shmid); in main() 141 rm_shm(shmid); in main() 147 int shmid, chld_pid; in child() local 155 if ((shmid = shmget(key, SIZE, 0)) < 0) { in child() 159 errno, shmid, chld_pid); in child() [all …]
|
D | shmt02.c | 58 register int shmid; in main() local 67 if ((shmid = shmget(key, 16 * K_1, IPC_CREAT | 0666)) < 0) { in main() 71 shmid, errno); in main() 78 cp = shmat(shmid, NULL, 0); in main() 83 shmid, errno); in main() 84 rm_shm(shmid); in main() 95 rm_shm(shmid); in main() 100 shmid); in main() 110 static int rm_shm(int shmid) in rm_shm() argument 112 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() [all …]
|
D | shmt08.c | 59 int shmid; in main() local 65 if ((shmid = shmget(key, 24 * K_1, IPC_CREAT | 0666)) < 0) { in main() 69 shmid, errno); in main() 72 cp = shmat(shmid, NULL, 0); in main() 75 rm_shm(shmid); in main() 79 cp1 = shmat(shmid, NULL, 0); in main() 82 rm_shm(shmid); in main() 103 rm_shm(shmid); in main() 107 static int rm_shm(int shmid) in rm_shm() argument 109 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() [all …]
|
D | shmt10.c | 62 int shmid; variable 96 if ((shmid = shmget(key, SIZE, IPC_CREAT | 0666)) < 0) { in main() 98 tst_brkm(TFAIL, NULL, "Error: shmid = %d\n", shmid); in main() 111 if ((c1 = shmat(shmid, NULL, 0)) == (char *)-1) { in main() 114 shmid); in main() 126 rm_shm(shmid); in main() 130 static int rm_shm(int shmid) in rm_shm() argument 132 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() 137 shmid, errno); in rm_shm() 148 if ((c1 = shmat(shmid, NULL, 0)) == (char *)-1) { in child() [all …]
|
D | shmt03.c | 60 int shmid; in main() local 68 if ((shmid = shmget(key, 16 * K_1, IPC_CREAT | 0666)) < 0) { in main() 72 shmid, errno); in main() 79 if ((cp1 = shmat(shmid, NULL, 0)) == (char *)-1) { in main() 82 shmid, errno); in main() 93 if ((cp2 = shmat(shmid, NULL, 0)) == (char *)-1) { in main() 96 shmid, errno); in main() 109 rm_shm(shmid); in main() 123 static int rm_shm(int shmid) in rm_shm() argument 125 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() [all …]
|
D | shmt07.c | 63 int shmid, pid, status; in main() local 72 if ((shmid = shmget(key, SIZE, IPC_CREAT | 0666)) < 0) { in main() 76 shmid, errno); in main() 78 cp = shmat(shmid, NULL, 0); in main() 84 shmid, errno); in main() 85 rm_shm(shmid); in main() 117 rm_shm(shmid); in main() 121 static int rm_shm(int shmid) in rm_shm() argument 123 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() 128 shmid, errno); in rm_shm()
|
D | shmt05.c | 60 int shmid, shmid1; in main() local 73 if ((shmid = shmget(key[0], SIZE, IPC_CREAT | 0666)) < 0) { in main() 77 shmid, errno); in main() 79 cp = shmat(shmid, NULL, 0); in main() 83 rm_shm(shmid); in main() 110 rm_shm(shmid); in main() 116 static int rm_shm(int shmid) in rm_shm() argument 118 if (shmctl(shmid, IPC_RMID, NULL) == -1) { in rm_shm() 123 shmid, errno); in rm_shm()
|
/external/linux-kselftest/tools/testing/selftests/vm/ |
D | hugepage-shm.c | 57 int shmid; in main() local 61 shmid = shmget(2, LENGTH, SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W); in main() 62 if (shmid < 0) { in main() 66 printf("shmid: 0x%x\n", shmid); in main() 68 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); in main() 71 shmctl(shmid, IPC_RMID, NULL); in main() 94 shmctl(shmid, IPC_RMID, NULL); in main() 98 shmctl(shmid, IPC_RMID, NULL); in main()
|
/external/ltp/testcases/kernel/mem/hugetlb/hugeshmat/ |
D | hugeshmat05.c | 64 int shmid; in shm_test() local 67 shmid = shmget(IPC_PRIVATE, size, 0600 | IPC_CREAT | SHM_HUGETLB); in shm_test() 68 if (shmid < 0) in shm_test() 71 shmaddr = shmat(shmid, 0, 0); in shm_test() 73 shmctl(shmid, IPC_RMID, NULL); in shm_test() 82 shmctl(shmid, IPC_RMID, NULL); in shm_test() 86 shmctl(shmid, IPC_RMID, NULL); in shm_test()
|
D | hugeshmat04.c | 60 int status, shmid; in shared_hugepage() local 64 shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | IPC_CREAT | 0777); in shared_hugepage() 65 if (shmid < 0) in shared_hugepage() 68 buf = shmat(shmid, (void *)BOUNDARY, SHM_RND | 0777); in shared_hugepage() 70 shmctl(shmid, IPC_RMID, NULL); in shared_hugepage() 81 shmctl(shmid, IPC_RMID, NULL); in shared_hugepage()
|
/external/ltp/include/ |
D | tst_safe_sysv_ipc.h | 52 void *safe_shmat(const char *file, const int lineno, int shmid, 54 #define SAFE_SHMAT(shmid, shmaddr, shmflg) \ argument 55 safe_shmat(__FILE__, __LINE__, (shmid), (shmaddr), (shmflg)) 60 int safe_shmctl(const char *file, const int lineno, int shmid, int cmd, 62 #define SAFE_SHMCTL(shmid, cmd, buf) ({ \ argument 63 int tst_ret_ = safe_shmctl(__FILE__, __LINE__, (shmid), (cmd), (buf)); \ 64 (shmid) = ((cmd) == IPC_RMID ? -1 : (shmid)); \
|
/external/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/ |
D | cpuset_memory_test.c | 247 static int shmid; in shm() local 261 shmid = shmget(key, memsize, flag); in shm() 262 if (shmid == -1) in shm() 264 shmctl(shmid, IPC_RMID, NULL); in shm() 266 shmid = shmget(key, memsize, flag); in shm() 267 if (shmid == -1) in shm() 270 p = shmat(shmid, NULL, 0); in shm() 272 shmctl(shmid, IPC_RMID, NULL); in shm() 279 if (shmctl(shmid, IPC_RMID, NULL) == -1) in shm()
|
/external/ltp/testcases/kernel/syscalls/mremap/ |
D | mremap04.c | 96 int shmid; /* shared memory identifier. */ variable 195 shmid = shmget(shmkey, newsize, IPC_CREAT | SHM_MODE); in setup() 196 if (shmid == -1) { in setup() 207 shmaddr = shmat(shmid, NULL, 0); in setup() 237 if (shmctl(shmid, IPC_RMID, 0) < 0) { in cleanup()
|
/external/ltp/lib/ |
D | tst_safe_sysv_ipc.c | 117 void *safe_shmat(const char *file, const int lineno, int shmid, in safe_shmat() argument 122 rval = shmat(shmid, shmaddr, shmflg); in safe_shmat() 125 file, lineno, shmid, shmaddr, shmflg); in safe_shmat() 144 int safe_shmctl(const char *file, const int lineno, int shmid, int cmd, in safe_shmctl() argument 149 rval = shmctl(shmid, cmd, buf); in safe_shmctl() 153 file, lineno, shmid, cmd, buf, rval); in safe_shmctl()
|
/external/mesa3d/src/gallium/winsys/sw/xlib/ |
D | xlib_sw_winsys.c | 126 shminfo->shmid = -1; in alloc_shm() 129 shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); in alloc_shm() 130 if (shminfo->shmid < 0) { in alloc_shm() 134 shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); in alloc_shm() 136 shmctl(shminfo->shmid, IPC_RMID, 0); in alloc_shm() 169 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in alloc_shm_ximage() 184 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in alloc_shm_ximage() 259 if (xlib_dt->shminfo.shmid >= 0) { in xlib_displaytarget_destroy() 261 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in xlib_displaytarget_destroy() 263 xlib_dt->shminfo.shmid = -1; in xlib_displaytarget_destroy()
|
/external/webrtc/webrtc/modules/desktop_capture/x11/ |
D | x_server_pixel_buffer.cc | 88 if (shm_segment_info_->shmid != -1) in Release() 89 shmctl(shm_segment_info_->shmid, IPC_RMID, 0); in Release() 129 shm_segment_info_->shmid = -1; in InitShm() 136 shm_segment_info_->shmid = shmget( in InitShm() 139 if (shm_segment_info_->shmid != -1) { in InitShm() 141 reinterpret_cast<char*>(shmat(shm_segment_info_->shmid, 0, 0)); in InitShm() 150 << shm_segment_info_->shmid; in InitShm() 168 shmctl(shm_segment_info_->shmid, IPC_RMID, 0); in InitShm() 169 shm_segment_info_->shmid = -1; in InitShm()
|
/external/ltp/testcases/kernel/syscalls/setns/ |
D | setns02.c | 59 static int shmid; variable 110 p = shmat(shmid, NULL, 0); in do_child_newipc() 125 p = shmat(shmid, NULL, 0); in do_child_newipc() 203 shmid = shmget(ipc_key, getpagesize(), IPC_CREAT | 0666); in setup() 204 if (shmid == -1) in setup() 217 shmctl(shmid, IPC_RMID, NULL); in cleanup()
|
/external/ltp/testcases/kernel/mem/hugetlb/hugemmap/ |
D | hugemmap05.c | 71 static int key = -1, shmid = -1, fd = -1; variable 96 shmid = SAFE_SHMGET(key, (length / 2 * hugepagesize), in test_overcommit() 132 tst_res(TINFO, "shmid: 0x%x", shmid); in test_overcommit() 133 shmaddr = SAFE_SHMAT(shmid, ADDR, SHMAT_FLAGS); in test_overcommit() 168 SAFE_SHMCTL(shmid, IPC_RMID, NULL); in test_overcommit() 180 if (opt_shmid && shmid != -1) in cleanup() 181 SAFE_SHMCTL(shmid, IPC_RMID, NULL); in cleanup()
|
/external/syzkaller/sys/freebsd/ |
D | ipc.txt | 52 shmat(shmid ipc_shm, addr vma, flags flags[shmat_flags]) shmaddr 53 shmctl$IPC_STAT(shmid ipc_shm, cmd const[IPC_STAT], buf buffer[out]) 54 shmctl$IPC_SET(shmid ipc_shm, cmd const[IPC_SET], buf ptr[in, shmid_ds]) 55 shmctl$IPC_RMID(shmid ipc_shm, cmd const[IPC_RMID]) 56 shmctl$IPC_INFO(shmid ipc_shm, cmd const[IPC_INFO], buf buffer[out]) 57 shmctl$SHM_INFO(shmid ipc_shm, cmd const[SHM_INFO], buf buffer[out]) 58 shmctl$SHM_STAT(shmid ipc_shm, cmd const[SHM_STAT], buf buffer[out]) 59 shmctl$SHM_LOCK(shmid ipc_shm, cmd const[SHM_LOCK]) 60 shmctl$SHM_UNLOCK(shmid ipc_shm, cmd const[SHM_UNLOCK])
|
/external/ltp/testcases/kernel/controllers/memcg/functional/ |
D | memcg_process.c | 223 static int shmid; in shm() local 237 shmid = shmget(key, memsize, flag); in shm() 238 if (shmid == -1) in shm() 241 p = shmat(shmid, NULL, 0); in shm() 243 shmctl(shmid, IPC_RMID, NULL); in shm() 247 if (shmctl(shmid, IPC_RMID, NULL) == -1) in shm()
|
/external/syzkaller/sys/linux/ |
D | ipc.txt | 52 shmat(shmid ipc_shm, addr vma, flags flags[shmat_flags]) shmaddr 53 shmctl$IPC_STAT(shmid ipc_shm, cmd const[IPC_STAT], buf buffer[out]) 54 shmctl$IPC_SET(shmid ipc_shm, cmd const[IPC_SET], buf ptr[in, shmid_ds]) 55 shmctl$IPC_RMID(shmid ipc_shm, cmd const[IPC_RMID]) 56 shmctl$IPC_INFO(shmid ipc_shm, cmd const[IPC_INFO], buf buffer[out]) 57 shmctl$SHM_INFO(shmid ipc_shm, cmd const[SHM_INFO], buf buffer[out]) 58 shmctl$SHM_STAT(shmid ipc_shm, cmd const[SHM_STAT], buf buffer[out]) 59 shmctl$SHM_LOCK(shmid ipc_shm, cmd const[SHM_LOCK]) 60 shmctl$SHM_UNLOCK(shmid ipc_shm, cmd const[SHM_UNLOCK])
|
/external/autotest/client/site_tests/security_SysVIPC/ |
D | security_SysVIPC.py | 29 def find_attached(self, shmid): argument 39 cmd = 'grep "%s */SYSV" /proc/*/maps | sed "s/maps.*/exe/g"' % shmid 55 shmid = fields[1] 58 attached = self.find_attached(shmid)
|
/external/toybox/toys/pending/ |
D | ipcs.c | 152 int max_nr, i, shmid; in shm_array() local 209 if ((shmid = shmctl(i, SHM_STAT, &buf)) < 0 ) continue; in shm_array() 212 printf("%-10d %-10.10s", shmid, pw->pw_name); in shm_array() 213 else printf("%-10d %-10.10d", shmid, buf.shm_perm.uid); in shm_array() 222 printf("%-10d %-10.10s", shmid, pw->pw_name); in shm_array() 223 else printf("%-10d %-10.10d", shmid, buf.shm_perm.uid); in shm_array() 226 printf("%-10d %-10o", shmid, buf.shm_perm.mode & 0777); in shm_array() 238 printf("%-10d %-10.10s", shmid, pw->pw_name); in shm_array() 239 else printf("%-10d %-10.10d", shmid, buf.shm_perm.uid); in shm_array()
|