ID: 13596
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Semaphore related
Operating System: redhat 7.1
PHP Version: 4.0.6
New Comment:

yes


Previous Comments:
------------------------------------------------------------------------

[2002-01-16 05:45:42] [EMAIL PROTECTED]

yes

------------------------------------------------------------------------

[2002-01-14 02:31:31] [EMAIL PROTECTED]

Does this work on 4.1.1?

------------------------------------------------------------------------

[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]

Reply via email to