/third_party/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", 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()
|
/third_party/musl/libc-test/src/functional/ |
D | ipc_shm.c | 31 int shmid; in set() local 39 T(shmid = shmget(k, 100, IPC_CREAT|0666)); in set() 40 T(shmctl(shmid, IPC_RMID, 0)); in set() 41 T(shmid = shmget(k, 100, IPC_CREAT|IPC_EXCL|0666)); in set() 52 T(shmctl(shmid, IPC_STAT, &shmid_ds)); in set() 70 if ((p=shmat(shmid, 0, 0)) == 0) in set() 72 T(shmctl(shmid, IPC_STAT, &shmid_ds)); in set() 86 int shmid; in get() local 90 T(shmid = shmget(k, 0, 0)); in get() 93 if ((p=shmat(shmid, 0, SHM_RDONLY)) == 0) in get() [all …]
|
/third_party/ltp/testcases/kernel/mem/hugetlb/hugeshmat/ |
D | hugeshmat05.c | 47 int shmid; in shm_test() local 50 shmid = shmget(IPC_PRIVATE, size, 0600 | IPC_CREAT | SHM_HUGETLB); in shm_test() 51 if (shmid < 0) in shm_test() 54 shmaddr = shmat(shmid, 0, 0); in shm_test() 56 shmctl(shmid, IPC_RMID, NULL); in shm_test() 65 shmctl(shmid, IPC_RMID, NULL); in shm_test() 69 shmctl(shmid, IPC_RMID, NULL); in shm_test()
|
D | hugeshmat04.c | 50 int status, shmid; in shared_hugepage() local 55 shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | IPC_CREAT | 0777); in shared_hugepage() 56 if (shmid < 0) in shared_hugepage() 66 buf = shmat(shmid, (void *)boundary, SHM_RND | 0777); in shared_hugepage() 68 shmctl(shmid, IPC_RMID, NULL); in shared_hugepage() 79 shmctl(shmid, IPC_RMID, NULL); in shared_hugepage()
|
/third_party/ltp/include/ |
D | tst_safe_sysv_ipc.h | 40 void *safe_shmat(const char *file, const int lineno, int shmid, 42 #define SAFE_SHMAT(shmid, shmaddr, shmflg) \ argument 43 safe_shmat(__FILE__, __LINE__, (shmid), (shmaddr), (shmflg)) 48 int safe_shmctl(const char *file, const int lineno, int shmid, int cmd, 50 #define SAFE_SHMCTL(shmid, cmd, buf) ({ \ argument 51 int tst_ret_ = safe_shmctl(__FILE__, __LINE__, (shmid), (cmd), (buf)); \ 52 (shmid) = ((cmd) == IPC_RMID ? -1 : (shmid)); \
|
/third_party/ltp/testcases/kernel/syscalls/ipc/shmctl/ |
D | shmctl04.c | 62 int shmid, size, rss, swap; in parse_proc_sysvipc() local 72 &shmid, &size, &rss, &swap) > 0) { in parse_proc_sysvipc() 77 if (shmid > shmid_max) in parse_proc_sysvipc() 78 shmid_max = shmid; in parse_proc_sysvipc() 117 int i, shmid, cnt = 0; in verify_shminfo() local 130 shmid = shmctl(TST_RET, SHM_STAT_ANY, &ds); in verify_shminfo() 132 if (shmid == -1) { in verify_shminfo() 137 TST_RET, shmid); in verify_shminfo()
|
D | shmctl06.c | 27 int shmid; in run() local 33 shmid = shmget(key, SHM_SIZE, IPC_CREAT | IPC_EXCL | SHM_RW); in run() 34 if (shmid == -1) in run() 37 TEST(shmctl(shmid, IPC_STAT, (struct shmid_ds *)&buf_ds)); in run() 46 SAFE_SHMCTL(shmid, IPC_RMID, NULL); in run()
|
D | shmctl02.c | 47 static int libc_shmctl(int shmid, int cmd, void *buf) in libc_shmctl() argument 49 return shmctl(shmid, cmd, buf); in libc_shmctl() 52 static int sys_shmctl(int shmid, int cmd, void *buf) in sys_shmctl() argument 54 return tst_syscall(__NR_shmctl, shmid, cmd, buf); in sys_shmctl() 79 int (*shmctl)(int shmid, int cmd, void *buf);
|
/third_party/mesa3d/src/gallium/winsys/sw/dri/ |
D | dri_sw_winsys.c | 60 int shmid; member 102 dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600); in alloc_shm() 103 if (dri_sw_dt->shmid < 0) in alloc_shm() 106 addr = (char *) shmat(dri_sw_dt->shmid, NULL, 0); in alloc_shm() 108 shmctl(dri_sw_dt->shmid, IPC_RMID, NULL); in alloc_shm() 145 dri_sw_dt->shmid = -1; in dri_sw_displaytarget_create() 173 if (dri_sw_dt->shmid >= 0) { in dri_sw_displaytarget_destroy() 176 shmctl(dri_sw_dt->shmid, IPC_RMID, NULL); in dri_sw_displaytarget_destroy() 232 if (dri_sw_dt->shmid < 0) in dri_sw_displaytarget_get_handle() 234 whandle->handle = dri_sw_dt->shmid; in dri_sw_displaytarget_get_handle() [all …]
|
/third_party/gstreamer/gstplugins_base/sys/ximage/ |
D | ximagepool.c | 93 mem->SHMInfo.shmid, mem->SHMInfo.shmseg); in gst_ximage_memory_free() 229 mem->SHMInfo.shmid = -1; in ximage_memory_alloc() 280 mem->SHMInfo.shmid = in ximage_memory_alloc() 282 if (mem->SHMInfo.shmid == -1) in ximage_memory_alloc() 286 mem->SHMInfo.shmaddr = shmat (mem->SHMInfo.shmid, NULL, 0); in ximage_memory_alloc() 302 shmctl (mem->SHMInfo.shmid, IPC_RMID, NULL); in ximage_memory_alloc() 305 mem->SHMInfo.shmid, mem->SHMInfo.shmseg); in ximage_memory_alloc() 401 shmctl (mem->SHMInfo.shmid, IPC_RMID, NULL); in ximage_memory_alloc() 407 shmctl (mem->SHMInfo.shmid, IPC_RMID, NULL); in ximage_memory_alloc() 439 SHMInfo.shmid = -1; in gst_x_image_sink_check_xshm_calls() [all …]
|
/third_party/ltp/testcases/kernel/syscalls/mremap/ |
D | mremap04.c | 95 int shmid; /* shared memory identifier. */ variable 194 shmid = shmget(shmkey, newsize, IPC_CREAT | SHM_MODE); in setup() 195 if (shmid == -1) { in setup() 206 shmaddr = shmat(shmid, NULL, 0); in setup() 236 if (shmctl(shmid, IPC_RMID, 0) < 0) { in cleanup()
|
/third_party/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()
|
/third_party/mesa3d/src/glx/ |
D | drisw_glx.c | 60 XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy) in XCreateDrawable() argument 65 if ((pdp->shminfo.shmid > 0) && (shmid != pdp->shminfo.shmid)) in XCreateDrawable() 69 if (!xshm_error && shmid >= 0) { in XCreateDrawable() 70 pdp->shminfo.shmid = shmid; in XCreateDrawable() 100 pdp->shminfo.shmid = -1; in XCreateDrawable() 127 if (pdp->shminfo.shmid > 0) in XDestroyDrawable() 183 int shmid, char *data, void *loaderPrivate) in swrastXPutImage() argument 192 if (!pdp->ximage || shmid != pdp->shminfo.shmid) { in swrastXPutImage() 193 if (!XCreateDrawable(pdp, shmid, dpy)) in swrastXPutImage() 205 if (pdp->shminfo.shmid >= 0) { in swrastXPutImage() [all …]
|
/third_party/mesa3d/src/gallium/winsys/sw/xlib/ |
D | xlib_sw_winsys.c | 126 shminfo->shmid = -1; in alloc_shm() 130 shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600); in alloc_shm() 131 if (shminfo->shmid < 0) { in alloc_shm() 135 shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); in alloc_shm() 137 shmctl(shminfo->shmid, IPC_RMID, 0); in alloc_shm() 170 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in alloc_shm_ximage() 185 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in alloc_shm_ximage() 260 if (xlib_dt->shminfo.shmid >= 0) { in xlib_displaytarget_destroy() 262 shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); in xlib_displaytarget_destroy() 264 xlib_dt->shminfo.shmid = -1; in xlib_displaytarget_destroy()
|
/third_party/alsa-lib/src/ |
D | shmarea.c | 38 int shmid; member 55 struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr) in snd_shm_area_create() argument 59 area->shmid = shmid; in snd_shm_area_create()
|
/third_party/ltp/testcases/kernel/mem/hugetlb/hugemmap/ |
D | hugemmap05.c | 60 static int key = -1, shmid = -1, fd = -1; variable 79 shmid = SAFE_SHMGET(key, (length / 2 * hugepagesize), in test_overcommit() 115 tst_res(TINFO, "shmid: 0x%x", shmid); in test_overcommit() 116 shmaddr = SAFE_SHMAT(shmid, ADDR, SHMAT_FLAGS); in test_overcommit() 151 SAFE_SHMCTL(shmid, IPC_RMID, NULL); in test_overcommit() 163 if (opt_shmid && shmid != -1) in cleanup() 164 SAFE_SHMCTL(shmid, IPC_RMID, NULL); in cleanup()
|
/third_party/ltp/lib/ |
D | tst_safe_sysv_ipc.c | 160 void *safe_shmat(const char *file, const int lineno, int shmid, in safe_shmat() argument 165 rval = shmat(shmid, shmaddr, shmflg); in safe_shmat() 169 "shmat(%i, %p, %x) failed", shmid, shmaddr, shmflg); in safe_shmat() 192 int safe_shmctl(const char *file, const int lineno, int shmid, int cmd, in safe_shmctl() argument 197 rval = shmctl(shmid, cmd, buf); in safe_shmctl() 201 "shmctl(%i, %i, %p) failed", shmid, cmd, buf); in safe_shmctl() 204 "Invalid shmctl(%i, %i, %p) return value %d", shmid, in safe_shmctl()
|