Using SysV Shared Memory in PHP
| From: | Ilia Alshanestky | Date: | Thu, 31 Aug 2000 15:53:05 +0000 |
| Subject: | Using SysV Shared Memory in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14632@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to write a C daemon that would place some data in shared memory for php to read. My
C daemon takes a query via an AF_UNIX socket (Unix domain).Once it process' the query it puts
the data into shared memory and writes the shm key back to the socket so the php process knows which
key to attach.
Now my problem is,
That php doesn't offer a simple C style shm_at, it has shm_get_var which expects the data
in shm to be formatted in such a way that php can understand. I've had php put some test data
into shm, when I analyzed the memory address where it put the data I noticed a PHP header of sorts.
Unfortunately there are no docs as to what that header is and what format it is in. Now as I
understand in order for php to read shm created by C I need to add the same type of a header to SHM
my C program creates. How can I create this "header" is there any docs, or maybe some one
would be kind enough to offer an example?
Thanks,
Ilia