cvs: phpdoc /en/reference/shmop/functions shmop-open.xml

From: Date: Thu, 29 May 2003 23:22:51 +0000
Subject: cvs: phpdoc /en/reference/shmop/functions shmop-open.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969354055@lists.php.net to get a copy of this message
davey Thu May 29 19:22:51 2003 EDT Modified files: /phpdoc/en/reference/shmop/functions shmop-open.xml Log: changed example so that it uses ftok() instead of a static key Index: phpdoc/en/reference/shmop/functions/shmop-open.xml diff -u phpdoc/en/reference/shmop/functions/shmop-open.xml:1.2 phpdoc/en/reference/shmop/functions/shmop-open.xml:1.3 --- phpdoc/en/reference/shmop/functions/shmop-open.xml:1.2 Wed Apr 17 02:44:02 2002 +++ phpdoc/en/reference/shmop/functions/shmop-open.xml Thu May 29 19:22:51 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/shmop.xml, last change in rev 1.12 --> <refentry id="function.shmop-open"> <refnamediv> @@ -33,22 +33,22 @@ <simpara> "c" for create (sets IPC_CREATE) use this flag when you need to create a new shared memory segment or if a - segment with the same key exists, try to open it for read and write + segment with the same key exists, try to open it for read and write </simpara> </listitem> <listitem> <simpara> "w" for read &amp; write access - use this flag when you need to read and write to a shared memory segment, use this flag - in most cases. + use this flag when you need to read and write to a shared memory segment, use this flag + in most cases. </simpara> </listitem> <listitem> <simpara> "n" create a new memory segment (sets IPC_CREATE|IPC_EXCL) - use this flag when you want to create a new shared memory segment but if one - already exists with the same flag, fail. This is useful for security purposes, using this you - can prevent race condition exploits. + use this flag when you want to create a new shared memory segment but if one + already exists with the same flag, fail. This is useful for security purposes, using this you + can prevent race condition exploits. </simpara> </listitem> </itemizedlist> @@ -70,14 +70,16 @@ <programlisting role="php"> <![CDATA[ <?php -$shm_id = shmop_open(0x0fff, "c", 0644, 100); +$shm_key = ftok(__FILE__,'t'); +$shm_id = shmop_open($shm_key, "c", 0644, 100); ?> ]]> </programlisting> </example> </para> <para> - This example opened a shared memory block with a system id of 0x0fff. + This example opened a shared memory block with a system id returned by + <function>ftok</function>. </para> </refsect1> </refentry>

« previous php.doc (#969354055) next »