Lines Matching refs:shmop
47 PHP_MINIT(shmop),
51 PHP_MINFO(shmop),
58 ZEND_GET_MODULE(shmop)
100 php_shmop *shmop = shmop_from_obj(object); in shmop_free_obj() local
102 shmdt(shmop->addr); in shmop_free_obj()
104 zend_object_std_dtor(&shmop->std); in shmop_free_obj()
108 PHP_MINIT_FUNCTION(shmop) in PHP_MINIT_FUNCTION() argument
128 PHP_MINFO_FUNCTION(shmop) in PHP_MINFO_FUNCTION() argument
140 php_shmop *shmop; in PHP_FUNCTION() local
155 shmop = Z_SHMOP_P(return_value); in PHP_FUNCTION()
156 shmop->key = key; in PHP_FUNCTION()
157 shmop->shmflg |= mode; in PHP_FUNCTION()
162 shmop->shmatflg |= SHM_RDONLY; in PHP_FUNCTION()
165 shmop->shmflg |= IPC_CREAT; in PHP_FUNCTION()
166 shmop->size = size; in PHP_FUNCTION()
169 shmop->shmflg |= (IPC_CREAT | IPC_EXCL); in PHP_FUNCTION()
170 shmop->size = size; in PHP_FUNCTION()
183 if (shmop->shmflg & IPC_CREAT && shmop->size < 1) { in PHP_FUNCTION()
188 shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg); in PHP_FUNCTION()
189 if (shmop->shmid == -1) { in PHP_FUNCTION()
194 if (shmctl(shmop->shmid, IPC_STAT, &shm)) { in PHP_FUNCTION()
205 shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg); in PHP_FUNCTION()
206 if (shmop->addr == (char*) -1) { in PHP_FUNCTION()
211 shmop->size = shm.shm_segsz; in PHP_FUNCTION()
225 php_shmop *shmop; in PHP_FUNCTION() local
234 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
236 if (start < 0 || start > shmop->size) { in PHP_FUNCTION()
241 if (count < 0 || start > (ZEND_LONG_MAX - count) || start + count > shmop->size) { in PHP_FUNCTION()
246 startaddr = shmop->addr + start; in PHP_FUNCTION()
247 bytes = count ? count : shmop->size - start; in PHP_FUNCTION()
270 php_shmop *shmop; in PHP_FUNCTION() local
276 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
278 RETURN_LONG(shmop->size); in PHP_FUNCTION()
285 php_shmop *shmop; in PHP_FUNCTION() local
295 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
297 if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) { in PHP_FUNCTION()
302 if (offset < 0 || offset > shmop->size) { in PHP_FUNCTION()
307 …writesize = ((zend_long)ZSTR_LEN(data) < shmop->size - offset) ? (zend_long)ZSTR_LEN(data) : shmop… in PHP_FUNCTION()
308 memcpy(shmop->addr + offset, ZSTR_VAL(data), writesize); in PHP_FUNCTION()
318 php_shmop *shmop; in PHP_FUNCTION() local
324 shmop = Z_SHMOP_P(shmid); in PHP_FUNCTION()
326 if (shmctl(shmop->shmid, IPC_RMID, NULL)) { in PHP_FUNCTION()