1
0
mirror of https://github.com/php/doc-ru.git synced 2026-04-26 08:48:12 +02:00
Files
archived-doc-ru/reference/sem/functions/shm-attach.xml
T
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

134 lines
4.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 395ea247cf337110d795979e14841617aa9cefa9 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.shm-attach" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>shm_attach</refname>
<refpurpose>Создаёт или открывает сегмент разделяемой памяти</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>SysvSharedMemory</type><type>false</type></type><methodname>shm_attach</methodname>
<methodparam><type>int</type><parameter>key</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>size</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>permissions</parameter><initializer>0666</initializer></methodparam>
</methodsynopsis>
<para>
<function>shm_attach</function> возвращает идентификатор, который можно использовать
для доступа к разделяемой памяти System V по заданному ключу <parameter>key</parameter>. Первый
вызов создаёт сегмент размером <parameter>size</parameter> и опциональными битами прав доступа
<parameter>permissions</parameter>.
</para>
<para>
Следующий вызов <function>shm_attach</function> с тем же ключом
<parameter>key</parameter> вернёт другой экземпляр <classname>SysvSharedMemory</classname>, но они оба будут
указывать на один и тот же сегмент разделяемой памяти.
Параметры <parameter>size</parameter> и
<parameter>permissions</parameter> будут проигнорированы.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
Числовой идентификатор сегмента разделяемой памяти
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
Размер памяти. Если не задан, то по умолчанию будет использоваться
<literal>sysvshm.init_mem</literal> в &php.ini;. Если не задан
и он, тогда 10000 байт.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>permissions</parameter></term>
<listitem>
<para>
Опциональные биты прав доступа. По умолчанию 0666.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает экземпляр <classname>SysvSharedMemory</classname> в случае успешного выполнения&return.falseforfailure;.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
В случае успешного выполнения функция возвращает экземпляр <classname>SysvSharedMemory</classname>;
ранее возвращался ресурс (<type>resource</type>).
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>size</parameter> теперь допускает значение null.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>shm_detach</function></member>
<member><function>ftok</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->