I've tested your code on 4.1.1 release with the recent SHMOP patch that is 
already part of the latest CVS. The code worked fine and did not generate any 
warning or errors.

I did however commented out the sem_* functions.

Ilia

P.S. Try using the latest CVS

On January 16, 2002 01:17 pm, Robin Ericsson wrote:
> I was playing with shmop ext today, and found out it was full of errors :)
>
> This is my code:
> Writing:
>     define("SHMKEY", 0xDEAD);
>     define("SEMKEY", 0xCAFE);
>
>     $shm_id = @shmop_open(SHMKEY, "a", 0644, 10);
>     if (!$shm_id)
>     {
>      $sem_id = sem_get(SEMKEY, 1, 0666);
>      $shm_id = shmop_open(SHMKEY, "c", 0644, 10);
>      sem_acquire($sem_id);
>      shmop_write($shm_id, "0", 0);
>      sem_release($sem_id);
>     }
>
> Reading:
>   $shm_id = @shmop_open(SHMKEY, "a", 0644, 10);
>
>   if (!$shm_id)
>   {
>    return "0";
>   }
>   else
>   {
>    $count = shmop_read($shm_id, 0, shmop_size($shm_id));
>    shmop_close($shm_id);
>    return $count;
>   }
>
> Which give me the following error:
> Warning: String is not zero-terminated (0) (source: zend_execute_API.c:274)
>
>
> I'm using 4.1.1, btw.
>
>
> -- robin

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