Lines Matching refs:shmop

46 	PHP_MINIT(shmop),
50 PHP_MINFO(shmop),
57 ZEND_GET_MODULE(shmop)
99 php_shmop *shmop = shmop_from_obj(object); in shmop_free_obj() local
101 shmdt(shmop->addr); in shmop_free_obj()
103 zend_object_std_dtor(&shmop->std); in shmop_free_obj()
107 PHP_MINIT_FUNCTION(shmop) in PHP_MINIT_FUNCTION() argument
125 PHP_MINFO_FUNCTION(shmop) in PHP_MINFO_FUNCTION() argument
137 php_shmop *shmop; in PHP_FUNCTION() local
152 shmop = Z_SHMOP_P(return_value); in PHP_FUNCTION()
153 shmop->key = key; in PHP_FUNCTION()
154 shmop->shmflg |= mode; in PHP_FUNCTION()
159 shmop->shmatflg |= SHM_RDONLY; in PHP_FUNCTION()
162 shmop->shmflg |= IPC_CREAT; in PHP_FUNCTION()
163 shmop->size = size; in PHP_FUNCTION()
166 shmop->shmflg |= (IPC_CREAT | IPC_EXCL); in PHP_FUNCTION()
167 shmop->size = size; in PHP_FUNCTION()
180 if (shmop->shmflg & IPC_CREAT && shmop->size < 1) { in PHP_FUNCTION()
185 shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg); in PHP_FUNCTION()
186 if (shmop->shmid == -1) { in PHP_FUNCTION()
191 if (shmctl(shmop->shmid, IPC_STAT, &shm)) { in PHP_FUNCTION()
202 shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg); in PHP_FUNCTION()
203 if (shmop->addr == (char*) -1) { in PHP_FUNCTION()
208 shmop->size = shm.shm_segsz; in PHP_FUNCTION()
222 php_shmop *shmop; in PHP_FUNCTION() local
231 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
233 if (start < 0 || start > shmop->size) { in PHP_FUNCTION()
238 if (count < 0 || start > (ZEND_LONG_MAX - count) || start + count > shmop->size) { in PHP_FUNCTION()
243 startaddr = shmop->addr + start; in PHP_FUNCTION()
244 bytes = count ? count : shmop->size - start; in PHP_FUNCTION()
267 php_shmop *shmop; in PHP_FUNCTION() local
273 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
275 RETURN_LONG(shmop->size); in PHP_FUNCTION()
282 php_shmop *shmop; in PHP_FUNCTION() local
292 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
294 if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) { in PHP_FUNCTION()
299 if (offset < 0 || offset > shmop->size) { in PHP_FUNCTION()
304 …writesize = ((zend_long)ZSTR_LEN(data) < shmop->size - offset) ? (zend_long)ZSTR_LEN(data) : shmop in PHP_FUNCTION()
305 memcpy(shmop->addr + offset, ZSTR_VAL(data), writesize); in PHP_FUNCTION()
315 php_shmop *shmop; in PHP_FUNCTION() local
321 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
323 if (shmctl(shmop->shmid, IPC_RMID, NULL)) { in PHP_FUNCTION()