note 16651 added to function.shmop-open
| From: | Mitchell_Shnier at ieee dot orgZ | Date: | Wed, 07 Nov 2001 22:51:21 +0000 |
| Subject: | note 16651 added to function.shmop-open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20566@lists.php.net to get a copy of this message | ||
To check whether a particular shared memory segment is already created, you need to OR the
"a" and "c" flags. For example (where $SystemKey is the Unix key used by the
other process(es) with which you want to share this memory segment)...<BR>
$shm_id = shmop_open($SystemKey, "a" | "c", 0, 0);
if ($shm_id) {
<it is already created>
} else {
<you need to create it with shmop_open using "c" only>
}<BR>
Using only "a" does not work (just as using only IPC_EXCL in the Unix shmget() call is
meaningless). Also, use the ipcs shell command to see your shared memory segments.
--
http://www.php.net/manual/en/function.shmop-open.php
http://master.php.net/manage/user-notes.php?action=edit+16651
http://master.php.net/manage/user-notes.php?action=delete+16651
http://master.php.net/manage/user-notes.php?action=reject+16651