Re: shmop errors

From: Date: Fri, 18 Jan 2002 07:13:47 +0000
Subject: Re: shmop errors
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-77396@lists.php.net to get a copy of this message
On Thu, 2002-01-17 at 21:17, Ilia A. wrote: > You have the same script try open the shm segment 2 times, which is WRONG. > Here is a proper example of what you should be doing: > > <?php > define("SHMKEY", 0xDEAD); > define("SEMKEY", 0xCAFE); > > if( !($shm_id = shmop_open(SHMKEY, 'c', 0644,10)) ) { > exit("Segment already exists and you do not have write permissions to it, > or you cannot create a new segment\n"); > } > $data = shmop_read($shm_id, 0, shmop_size($shm_id)); > shmop_close($shm_id); > echo $data."\n"; > ?> Well, I know this was bad code, but I pasted code from two different scripts, and the script I made was short and displayed the problem, so I think it will do for that purpose :) > > I've also committed the patch to CVS that should eliminate the warning > message. I wonder why Zend required strings with defined length to be null > terminated, sounds like a recipe for disaster, if the length is known it > should be used. But, whatever, please try the latest CVS. Yes, I sent this to the list yesterday, and I can verify it works with the latest CVS. Thanks. -- Robin

« previous php.dev (#77396) next »