ID: 13596 Updated by: lobbin Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Semaphore related Operating System: redhat 7.1 PHP Version: 4.0.6 New Comment:
Does this work on 4.1.1? Previous Comments: ------------------------------------------------------------------------ [2001-10-08 11:30:28] [EMAIL PROTECTED] I got it working, but i had to change C source for it: in ext/shmop/shmop.c -------------------------- if (memchr((*flags)->value.str.val, 'a', (*flags)->value.str.len)) { shmflg = SHM_RDONLY; shmop->shmflg |= IPC_EXCL; } ------------- changed to: ------------- if (memchr((*flags)->value.str.val, 'a', (*flags)->value.str.len)) { shmop->shmflg |= IPC_EXCL; shmop->shmflg |= SHM_R; shmop->shmflg |= SHM_W; } ------------- and it worked.... I hope php 4.0.7 will implement some patch too for it (CVS is still buggy) Thx. O. ------------------------------------------------------------------------ [2001-10-08 07:33:08] [EMAIL PROTECTED] Hi. Its seems to be impossible to use shmop_write if you are opening memory segment secong time. example code (produces crash): $mid = 0xffe; $shm_id = shmop_open($mid, "c", 0644, 100); if(!$shm_id) { echo "Couldn't create shared memory segment\n"; } $shm_bytes_written = shmop_write($shm_id, "my shared memory block", 0); if($shm_bytes_written != strlen("my shared memory block")) { echo "Couldn't write the entire length of data\n"; } shmop_close($shm_id); $shm_id = shmop_open($mid, "a", 0, 0); $shm_bytes_written = shmop_write($shm_id, "my shared memory block", 0); if($shm_bytes_written != strlen("my shared memory block")) { echo "Couldn't write the entire length of data\n"; } shmop_close($shm_id); I did somehting wrong? or i should use other release of PHP? O. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13596&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]