cvs: phpdoc-es /reference/shmop/functions shmop-open.xml
| From: | Javier Eguiluz | Date: | Thu, 23 Oct 2003 18:23:19 +0000 |
| Subject: | cvs: phpdoc-es /reference/shmop/functions shmop-open.xml | ||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-354@lists.php.net to get a copy of this message | ||
javi Thu Oct 23 14:23:19 2003 EDT
Modified files:
/phpdoc-es/reference/shmop/functions shmop-open.xml
Log:
Index: phpdoc-es/reference/shmop/functions/shmop-open.xml
diff -u phpdoc-es/reference/shmop/functions/shmop-open.xml:1.1
phpdoc-es/reference/shmop/functions/shmop-open.xml:1.2
--- phpdoc-es/reference/shmop/functions/shmop-open.xml:1.1 Sun Apr 14 20:18:43 2002
+++ phpdoc-es/reference/shmop/functions/shmop-open.xml Thu Oct 23 14:23:19 2003
@@ -1,68 +1,90 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./es/functions/shmop.xml, last change in rev 1.1 -->
-<!-- last change to 'shmop-open' in en/ tree in rev 1.12 -->
- <refentry id="function.shmop_open">
+<!-- $Revision: 1.2 $ -->
+<!-- EN-Revision: 1.4 Maintainer: javi Status: ready -->
+<!-- splitted from ./en/functions/shmop.xml, last change in rev 1.12 -->
+ <refentry id="function.shmop-open">
<refnamediv>
<refname>shmop_open</refname>
- <refpurpose>Create or open shared memory block</refpurpose>
+ <refpurpose>Crea o abre un segmento de memoria compartida</refpurpose>
</refnamediv>
<refsect1>
- <title>Description</title>
+ <title>Descripción</title>
<methodsynopsis>
<type>int</type><methodname>shmop_open</methodname>
-
<methodparam><type>int</type><parameter>key</parameter></methodparam>
-
<methodparam><type>string</type><parameter>flags</parameter></methodparam>
-
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
-
<methodparam><type>int</type><parameter>size</parameter></methodparam>
+
<methodparam><type>int</type><parameter>clave</parameter></methodparam>
+
<methodparam><type>string</type><parameter>opciones</parameter></methodparam>
+
<methodparam><type>int</type><parameter>modo</parameter></methodparam>
+
<methodparam><type>int</type><parameter>tamanio</parameter></methodparam>
</methodsynopsis>
<para>
- <function>shmop_open</function> can create or open a shared memory block.
+ <function>shmop_open</function> se utiliza para crear o abrir un segmento
+ de memoria compartida.
</para>
<para>
- <function>shmop_open</function> takes 4 parameters: key, which is the
- system's id for the shared memory block, this parameter can be passed
- as a decimal or hex. The second parameter are the flags that you can use:
+ <function>shmop_open</function> utiliza 4 parametros: clave, que es el
+ identificador que el sistema utilizará para ese segmento de memoria
+ compartida y que puede ser indicado tanto en formato decimal como
+ hexadecimal. El segundo parámetro son las opciones que se pueden
+ utilizar:
<itemizedlist>
<listitem>
<simpara>
- "a" for access (sets IPC_EXCL)
- use this flag when you need to open an existing shared memory segment
+ "a" para acceder (se activa SHM_RDONLY en el shmat) se utiliza esta
+ opción para abrir un segmento de memoria compartida que ya existe en
+ modo de solo lectura.
+ </simpa ra>
+ </listi tem>
+ <listitem>
+ <simpara>
+ "c" para crear (se activa IPC_CREATE) se utiliza esta opción
+ para crear un nuevo segmento de memoria compartida o para intentar abrir en
+ modo de lectura y escritura un segmento que ya existe.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "w" para acceder en modo de lectura y escritura. Se utiliza esta
+ opción para poder leer un segmento de memoria compartida y
+ además poder escribir en el. Se trata de la opción
+ más habitual en la mayoría de los casos.
</simpara>
</listitem>
<listitem>
<simpara>
- "c" for create (sets IPC_CREATE)
- use this flag when you need to create a new shared memory segment.
+ "n" para crear un nuevo segmento de memoria compartida (se activan
IPC_CREATE|IPC_EXCL) se utiliza esta opción para crear un nuevo segmento de memoria
compartida a no ser que ya exista otro segmento de memoria compartida con la misma clave. Esta
opción es útil por motivos de seguridad para evitar por ejemplo
"condiciones de carrera" (en inglés "race
conditions").
</simpara>
</listitem>
- </itemizedlist>
- The third parameter is the mode, which are the permissions that you
- wish to assign to your memory segment, those are the same as permission
- for a file. Permissions need to be passed in octal form ex. 0644.
- The last parameter is size of the shared memory block you wish to create
- in bytes.
+ </itemi zedlist>
+ El tercer parámetro es el modo, que son los permisos que se van a
+ asignar al segmento de memoria compartida. Estos permisos son similares a
+ los que se asignan a los archivos. La forma de indicar los permisos es
+ identica a la que se utiliza en sistemas UNIX para indicar los permisos
+ de los archivos, como por ejemplo "0644". El último
+ parámetro es el tamaño en bytes del segmento de memoria compartida
+ que se va a crear.
<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
- you've created.
+ Nota: el tercer y cuarto parámetro deben ser igual a 0 (cero) si se
está abriendo un segmento de memoria compartida existente. Si la función
<function>shmop_open</function> tiene éxito, devolverá un
identificador que se puede utilizar posteriormente para acceder al segmento de memoria compartida
que se ha creado.
</simpara></note>
</para>
<para>
<example>
- <title>Create a new shared memory block</title>
+ <title>Creación de un nuevo segmento de memoria compartida</title>
<programlisting role="php">
-<?php
-$shm_id = shmop_open(0x0fff, "c", 0644, 100);
-?>
+<![CDATA[
+<?php
+$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.
+ En el ejemplo anterior se crea un nuevo segmento de memoria compartida
+ cuya clave se ha generado con ayuda de la función
<function>ftok</function>.
</para>
</refsect1>
- </refentry>
+ </refentry>
<!-- Keep this comment at the end of the file
Local variables: