Lines Matching refs:shmop

100 	PHP_MINIT(shmop),
104 PHP_MINFO(shmop),
111 ZEND_GET_MODULE(shmop) in ZEND_GET_MODULE() argument
115 shmop = zend_list_find(shmid, &type); \ in ZEND_GET_MODULE()
116 if (!shmop) { \
128 struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr; local
130 shmdt(shmop->addr);
131 efree(shmop);
137 PHP_MINIT_FUNCTION(shmop) in PHP_MINIT_FUNCTION() argument
147 PHP_MINFO_FUNCTION(shmop) in PHP_MINFO_FUNCTION() argument
160 struct php_shmop *shmop; in PHP_FUNCTION() local
175 shmop = emalloc(sizeof(struct php_shmop)); in PHP_FUNCTION()
176 memset(shmop, 0, sizeof(struct php_shmop)); in PHP_FUNCTION()
178 shmop->key = key; in PHP_FUNCTION()
179 shmop->shmflg |= mode; in PHP_FUNCTION()
184 shmop->shmatflg |= SHM_RDONLY; in PHP_FUNCTION()
187 shmop->shmflg |= IPC_CREAT; in PHP_FUNCTION()
188 shmop->size = size; in PHP_FUNCTION()
191 shmop->shmflg |= (IPC_CREAT | IPC_EXCL); in PHP_FUNCTION()
192 shmop->size = size; in PHP_FUNCTION()
205 if (shmop->shmflg & IPC_CREAT && shmop->size < 1) { in PHP_FUNCTION()
210 shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg); in PHP_FUNCTION()
211 if (shmop->shmid == -1) { in PHP_FUNCTION()
216 if (shmctl(shmop->shmid, IPC_STAT, &shm)) { in PHP_FUNCTION()
221 shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg); in PHP_FUNCTION()
222 if (shmop->addr == (char*) -1) { in PHP_FUNCTION()
227 shmop->size = shm.shm_segsz; in PHP_FUNCTION()
229 rsid = zend_list_insert(shmop, shm_type TSRMLS_CC); in PHP_FUNCTION()
232 efree(shmop); in PHP_FUNCTION()
242 struct php_shmop *shmop; in PHP_FUNCTION() local
254 if (start < 0 || start > shmop->size) { in PHP_FUNCTION()
259 if (count < 0 || start > (INT_MAX - count) || start + count > shmop->size) { in PHP_FUNCTION()
264 startaddr = shmop->addr + start; in PHP_FUNCTION()
265 bytes = count ? count : shmop->size - start; in PHP_FUNCTION()
280 struct php_shmop *shmop; in PHP_FUNCTION() local
298 struct php_shmop *shmop; in PHP_FUNCTION() local
307 RETURN_LONG(shmop->size); in PHP_FUNCTION()
315 struct php_shmop *shmop; in PHP_FUNCTION() local
328 if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) { in PHP_FUNCTION()
333 if (offset < 0 || offset > shmop->size) { in PHP_FUNCTION()
338 writesize = (data_len < shmop->size - offset) ? data_len : shmop->size - offset; in PHP_FUNCTION()
339 memcpy(shmop->addr + offset, data, writesize); in PHP_FUNCTION()
350 struct php_shmop *shmop; in PHP_FUNCTION() local
359 if (shmctl(shmop->shmid, IPC_RMID, NULL)) { in PHP_FUNCTION()