yohgaki Wed Jan 9 19:59:17 2002 EDT
Modified files:
/phpdoc/en/functions shmop.xml
Log:
Additional features are added. Patch by [EMAIL PROTECTED]
Index: phpdoc/en/functions/shmop.xml
diff -u phpdoc/en/functions/shmop.xml:1.11 phpdoc/en/functions/shmop.xml:1.12
--- phpdoc/en/functions/shmop.xml:1.11 Wed Dec 12 15:47:25 2001
+++ phpdoc/en/functions/shmop.xml Wed Jan 9 19:59:17 2002
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<reference id="ref.shmop">
<title>Shared Memory Functions</title>
<titleabbrev>shmop</titleabbrev>
-
+
<partintro>
<para>
Shmop is an easy to use set of functions that allows php to read,
@@ -89,14 +89,30 @@
<itemizedlist>
<listitem>
<simpara>
- "a" for access (sets IPC_EXCL)
- use this flag when you need to open an existing shared memory segment
+ "a" for access (sets SHM_RDONLY for shmat)
+ use this flag when you need to open an existing shared memory segment for
+read only
</simpara>
</listitem>
<listitem>
<simpara>
"c" for create (sets IPC_CREATE)
- use this flag when you need to create a new shared memory segment.
+ 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
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "w" for read & write access
+ 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.
</simpara>
</listitem>
</itemizedlist>
@@ -108,10 +124,10 @@
<note><simpara>
Note: the 3rd and 4th should be entered as 0 if you are opening an
existing memory segment. On success <function>shmop_open</function> will
- return an id that you can use to access the shared memory segment
+ return an id that you can use to access the shared memory segment
you've created.
</simpara></note>
- </para>
+ </para>
<para>
<example>
<title>Create a new shared memory block</title>
@@ -128,8 +144,8 @@
This example opened a shared memory block with a system id of 0x0fff.
</para>
</refsect1>
- </refentry>
-
+ </refentry>
+
<refentry id="function.shmop-read">
<refnamediv>
<refname>shmop_read</refname>
@@ -152,7 +168,7 @@
<function>shmop_read</function> takes 3 parameters: shmid, which is the shared
memory block identifier created by <function>shmop_open</function>, offset from
which to start reading and count on the number of bytes to read.
- </para>
+ </para>
<para>
<example>
<title>Reading shared memory block</title>
@@ -171,7 +187,7 @@
</para>
</refsect1>
</refentry>
-
+
<refentry id="function.shmop-write">
<refnamediv>
<refname>shmop_write</refname>
@@ -195,7 +211,7 @@
shared memory block identifier created by <function>shmop_open</function>,
data, a string that you want to write into shared memory block and offset,
which specifies where to start writing data inside the shared memory segment.
- </para>
+ </para>
<para>
<example>
<title>Writing to shared memory block</title>