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