Page 1 of 1

Get data from C process shared memory

Posted: Fri Jul 22, 2005 2:08 am
by vily
Hi there from Barcelona
I'm trying to get data from a shared memory segment created by a C process on a linux machine. I'm able to connect with the segment with shmop functions and I get the raw data.
The C process that manage this shm deals with it throught a struct type definition. Is there any easy way to do something similar with PHP? I mean, with the shm already attached in the php script, and, maybe, with some class definition similar from the C struct type, giving the shm raw data a easy way to access it.
I've been reading about serialize/deserialize, but some extra information is given when you serialize some data, information that my shm segment lacks of.
Any suggestions would be apreciatted.
Thanks a lot
vily

Posted: Fri Jul 22, 2005 4:12 am
by Weirdan
consider using unpack function.