| 1 |
# Russian translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# aereiae <[email protected]>, 2014. |
| 5 |
# Alexey <[email protected]>, 2015. |
| 6 |
# Azamat Hackimov <[email protected]>, 2013-2017. |
| 7 |
# Dmitriy S. Seregin <[email protected]>, 2013. |
| 8 |
# Dmitry Bolkhovskikh <[email protected]>, 2017. |
| 9 |
# ITriskTI <[email protected]>, 2013. |
| 10 |
# Max Is <[email protected]>, 2016. |
| 11 |
# Yuri Kozlov <[email protected]>, 2011-2019. |
| 12 |
# Иван Павлов <[email protected]>, 2017. |
| 13 |
# Малянов Евгений Викторович <[email protected]>, 2014. |
| 14 |
msgid "" |
| 15 |
msgstr "" |
| 16 |
"Project-Id-Version: manpages-l10n\n" |
| 17 |
"POT-Creation-Date: 2026-06-05 06:31+0200\n" |
| 18 |
"PO-Revision-Date: 2024-12-21 19:49+0300\n" |
| 19 |
"Last-Translator: Yuri Kozlov <[email protected]>\n" |
| 20 |
"Language-Team: Russian <[email protected]>\n" |
| 21 |
"Language: ru\n" |
| 22 |
"MIME-Version: 1.0\n" |
| 23 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 24 |
"Content-Transfer-Encoding: 8bit\n" |
| 25 |
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " |
| 26 |
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " |
| 27 |
"(n%100>=11 && n%100<=14)? 2 : 3);\n" |
| 28 |
"X-Generator: Lokalize 2.0\n" |
| 29 |
|
| 30 |
#. type: TH |
| 31 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 32 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 33 |
#, no-wrap |
| 34 |
msgid "memfd_create" |
| 35 |
msgstr "memfd_create" |
| 36 |
|
| 37 |
#. type: TH |
| 38 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 39 |
#: opensuse-tumbleweed |
| 40 |
#, no-wrap |
| 41 |
msgid "2026-02-08" |
| 42 |
msgstr "8 февраля 2026 г." |
| 43 |
|
| 44 |
#. type: TH |
| 45 |
#: archlinux debian-unstable |
| 46 |
#, fuzzy, no-wrap |
| 47 |
#| msgid "Linux man-pages 6.17" |
| 48 |
msgid "Linux man-pages 6.18" |
| 49 |
msgstr "Справочные страницы Linux 6.17" |
| 50 |
|
| 51 |
#. type: SH |
| 52 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 53 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 54 |
#, no-wrap |
| 55 |
msgid "NAME" |
| 56 |
msgstr "НАИМЕНОВАНИЕ" |
| 57 |
|
| 58 |
#. type: Plain text |
| 59 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 60 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 61 |
msgid "memfd_create - create an anonymous file" |
| 62 |
msgstr "memfd_create - создаёт анонимный файл" |
| 63 |
|
| 64 |
#. type: SH |
| 65 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 66 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 67 |
#, no-wrap |
| 68 |
msgid "LIBRARY" |
| 69 |
msgstr "БИБЛИОТЕКА" |
| 70 |
|
| 71 |
#. type: Plain text |
| 72 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 73 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 74 |
msgid "Standard C library (I<libc>,\\ I<-lc>)" |
| 75 |
msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)" |
| 76 |
|
| 77 |
#. type: SH |
| 78 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 79 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 80 |
#, no-wrap |
| 81 |
msgid "SYNOPSIS" |
| 82 |
msgstr "СИНТАКСИС" |
| 83 |
|
| 84 |
#. type: Plain text |
| 85 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 86 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 87 |
#, no-wrap |
| 88 |
msgid "" |
| 89 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 90 |
"B<#include E<lt>sys/mman.hE<gt>>\n" |
| 91 |
msgstr "" |
| 92 |
"B<#define _GNU_SOURCE> /* Смотрите feature_test_macros(7) */\n" |
| 93 |
"B<#include E<lt>sys/mman.hE<gt>>\n" |
| 94 |
|
| 95 |
#. type: Plain text |
| 96 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 97 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 98 |
#, no-wrap |
| 99 |
msgid "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>\n" |
| 100 |
msgstr "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>\n" |
| 101 |
|
| 102 |
#. type: SH |
| 103 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 104 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 105 |
#, no-wrap |
| 106 |
msgid "DESCRIPTION" |
| 107 |
msgstr "ОПИСАНИЕ" |
| 108 |
|
| 109 |
#. #-#-#-#-# archlinux: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 110 |
#. David Herrmann: |
| 111 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 112 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 113 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 114 |
#. those are accounted on "current" and "current->mm", that is, the |
| 115 |
#. process doing the first page access. |
| 116 |
#. type: Plain text |
| 117 |
#. #-#-#-#-# debian-trixie: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 118 |
#. David Herrmann: |
| 119 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 120 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 121 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 122 |
#. those are accounted on "current" and "current->mm", that is, the |
| 123 |
#. process doing the first page access. |
| 124 |
#. type: Plain text |
| 125 |
#. #-#-#-#-# debian-unstable: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 126 |
#. David Herrmann: |
| 127 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 128 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 129 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 130 |
#. those are accounted on "current" and "current->mm", that is, the |
| 131 |
#. process doing the first page access. |
| 132 |
#. type: Plain text |
| 133 |
#. #-#-#-#-# fedora-44: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 134 |
#. David Herrmann: |
| 135 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 136 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 137 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 138 |
#. those are accounted on "current" and "current->mm", that is, the |
| 139 |
#. process doing the first page access. |
| 140 |
#. type: Plain text |
| 141 |
#. #-#-#-#-# fedora-rawhide: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 142 |
#. David Herrmann: |
| 143 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 144 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 145 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 146 |
#. those are accounted on "current" and "current->mm", that is, the |
| 147 |
#. process doing the first page access. |
| 148 |
#. type: Plain text |
| 149 |
#. #-#-#-#-# mageia-cauldron: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 150 |
#. David Herrmann: |
| 151 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 152 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 153 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 154 |
#. those are accounted on "current" and "current->mm", that is, the |
| 155 |
#. process doing the first page access. |
| 156 |
#. type: Plain text |
| 157 |
#. #-#-#-#-# opensuse-leap-16-1: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 158 |
#. David Herrmann: |
| 159 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 160 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 161 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 162 |
#. those are accounted on "current" and "current->mm", that is, the |
| 163 |
#. process doing the first page access. |
| 164 |
#. type: Plain text |
| 165 |
#. #-#-#-#-# opensuse-tumbleweed: memfd_create.2.pot (PACKAGE VERSION) #-#-#-#-# |
| 166 |
#. David Herrmann: |
| 167 |
#. memfd uses VM_NORESERVE so each page is accounted on first access. |
| 168 |
#. This means, the overcommit-limits (see __vm_enough_memory()) and the |
| 169 |
#. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that |
| 170 |
#. those are accounted on "current" and "current->mm", that is, the |
| 171 |
#. process doing the first page access. |
| 172 |
#. type: Plain text |
| 173 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 174 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 175 |
msgid "" |
| 176 |
"B<memfd_create>() creates an anonymous file and returns a file descriptor " |
| 177 |
"that refers to it. The file behaves like a regular file, and so can be " |
| 178 |
"modified, truncated, memory-mapped, and so on. However, unlike a regular " |
| 179 |
"file, it lives in RAM and has a volatile backing storage. Once all " |
| 180 |
"references to the file are dropped, it is automatically released. Anonymous " |
| 181 |
"memory is used for all backing pages of the file. Therefore, files created " |
| 182 |
"by B<memfd_create>() have the same semantics as other anonymous memory " |
| 183 |
"allocations such as those allocated using B<mmap>(2) with the " |
| 184 |
"B<MAP_ANONYMOUS> flag." |
| 185 |
msgstr "" |
| 186 |
"Вызов B<memfd_create>() создаёт анонимный файл и возвращает ссылающийся на " |
| 187 |
"него файловый дескриптор. Анонимный файл ведёт себя как обычный файл и может " |
| 188 |
"быть изменён, обрезан, отображён в память и т.д. Однако в отличие от " |
| 189 |
"обычного файла он располагается в ОЗУ и не имеет энергонезависимого " |
| 190 |
"хранилища. Как только все ссылки на файл удаляются, он автоматически " |
| 191 |
"исчезает. Анонимные файлы располагаются в анонимной памяти. Поэтому у " |
| 192 |
"файлов, создаваемых B<memfd_create>(), такая же семантика как и областей " |
| 193 |
"анонимной памяти, выделяемой с помощью B<mmap>(2) с флагом B<MAP_ANONYMOUS>." |
| 194 |
|
| 195 |
#. type: Plain text |
| 196 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 197 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 198 |
msgid "" |
| 199 |
"The initial size of the file is set to 0. Following the call, the file size " |
| 200 |
"should be set using B<ftruncate>(2). (Alternatively, the file may be " |
| 201 |
"populated by calls to B<write>(2) or similar.)" |
| 202 |
msgstr "" |
| 203 |
"Первоначально, размер файла равен 0. После этого вызова нужно задать размер " |
| 204 |
"файла с помощью B<ftruncate>(2) (или заполнить файл с помощью B<write>(2) " |
| 205 |
"или подобными)." |
| 206 |
|
| 207 |
#. type: Plain text |
| 208 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 209 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 210 |
msgid "" |
| 211 |
"The name supplied in I<name> is used as a filename and will be displayed as " |
| 212 |
"the target of the corresponding symbolic link in the directory I</proc/self/" |
| 213 |
"fd/>. The displayed name is always prefixed with I<memfd:> and serves only " |
| 214 |
"for debugging purposes. Names do not affect the behavior of the file " |
| 215 |
"descriptor, and as such multiple files can have the same name without any " |
| 216 |
"side effects." |
| 217 |
msgstr "" |
| 218 |
"Имя, указанное в I<name>, используется в качестве имени файла и будет " |
| 219 |
"показываться как цель соответствующей символьной ссылки в каталоге. I</proc/" |
| 220 |
"self/fd/>. Отображаемое имя всегда начинается с I<memfd:> и служит только " |
| 221 |
"для отладки. Имена не влияют на поведение файлового дескриптора и поэтому " |
| 222 |
"несколько файлов могут иметь одно имя без каких-либо последствий." |
| 223 |
|
| 224 |
#. type: Plain text |
| 225 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 226 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 227 |
msgid "" |
| 228 |
"The following values may be bitwise ORed in I<flags> to change the behavior " |
| 229 |
"of B<memfd_create>():" |
| 230 |
msgstr "" |
| 231 |
"Для изменения поведения B<memfd_create>() можно использовать следующие " |
| 232 |
"значения I<flags> (через OR):" |
| 233 |
|
| 234 |
#. type: TP |
| 235 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 236 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 237 |
#, no-wrap |
| 238 |
msgid "B<MFD_CLOEXEC>" |
| 239 |
msgstr "B<MFD_CLOEXEC>" |
| 240 |
|
| 241 |
#. type: Plain text |
| 242 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 243 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 244 |
msgid "" |
| 245 |
"Set the close-on-exec (B<FD_CLOEXEC>) flag on the new file descriptor. See " |
| 246 |
"the description of the B<O_CLOEXEC> flag in B<open>(2) for reasons why this " |
| 247 |
"may be useful." |
| 248 |
msgstr "" |
| 249 |
"Устанавливает флаг close-on-exec (B<FD_CLOEXEC>) для нового открытого " |
| 250 |
"файлового дескриптора. Смотрите описание флага B<O_CLOEXEC> в B<open>(2) для " |
| 251 |
"того, чтобы узнать как это может пригодиться." |
| 252 |
|
| 253 |
#. type: TP |
| 254 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 255 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 256 |
#, no-wrap |
| 257 |
msgid "B<MFD_ALLOW_SEALING>" |
| 258 |
msgstr "B<MFD_ALLOW_SEALING>" |
| 259 |
|
| 260 |
#. FIXME Why is the MFD_ALLOW_SEALING behavior not simply the default? |
| 261 |
#. Is it worth adding some text explaining this? |
| 262 |
#. type: Plain text |
| 263 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 264 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 265 |
msgid "" |
| 266 |
"Allow sealing operations on this file. See the discussion of the " |
| 267 |
"B<F_ADD_SEALS> and B<F_GET_SEALS> operations in B<fcntl>(2), and also NOTES, " |
| 268 |
"below. The initial set of seals is empty. If this flag is not set, the " |
| 269 |
"initial set of seals will be B<F_SEAL_SEAL>, meaning that no other seals can " |
| 270 |
"be set on the file." |
| 271 |
msgstr "" |
| 272 |
"Разрешает операции опечатывания (sealing) файла. Описание операций " |
| 273 |
"B<F_ADD_SEALS> и B<F_GET_SEALS> смотрите в B<fcntl>(2), а также в ЗАМЕЧАНИЯ " |
| 274 |
"ниже. Первоначально набор печатей пуст. Если этот флаг не установлен, то " |
| 275 |
"начальным набором печатей будет B<F_SEAL_SEAL>, означающий запрещение " |
| 276 |
"установки печатей на файл." |
| 277 |
|
| 278 |
#. type: TP |
| 279 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 280 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 281 |
#, no-wrap |
| 282 |
msgid "B<MFD_HUGETLB> (since Linux 4.14)" |
| 283 |
msgstr "B<MFD_HUGETLB> (начиная с Linux 4.14)" |
| 284 |
|
| 285 |
#. commit 749df87bd7bee5a79cef073f5d032ddb2b211de8 |
| 286 |
#. commit 47b9012ecdc747f6936395265e677d41e11a31ff |
| 287 |
#. type: Plain text |
| 288 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 289 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 290 |
msgid "" |
| 291 |
"The anonymous file will be created in the hugetlbfs filesystem using huge " |
| 292 |
"pages. See the Linux kernel source file I<Documentation/admin-guide/mm/" |
| 293 |
"hugetlbpage.rst> for more information about hugetlbfs. Specifying both " |
| 294 |
"B<MFD_HUGETLB> and B<MFD_ALLOW_SEALING> in I<flags> is supported since Linux " |
| 295 |
"4.16." |
| 296 |
msgstr "" |
| 297 |
"В файловой системе hugetlbfs, использующей огромные страницы, будет создан " |
| 298 |
"анонимный файл. В файле исходного кода Linux I<Documentation/admin-guide/mm/" |
| 299 |
"hugetlbpage.rst> дана подробная информация о hugetlbfs. Одновременное " |
| 300 |
"указание B<MFD_HUGETLB> и B<MFD_ALLOW_SEALING> в I<flags> поддерживается " |
| 301 |
"начиная с Linux 4.16." |
| 302 |
|
| 303 |
#. type: TP |
| 304 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 305 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 306 |
#, no-wrap |
| 307 |
msgid "B<MFD_HUGE_2MB>" |
| 308 |
msgstr "" |
| 309 |
|
| 310 |
#. type: TQ |
| 311 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 312 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 313 |
#, no-wrap |
| 314 |
msgid "B<MFD_HUGE_1GB>" |
| 315 |
msgstr "" |
| 316 |
|
| 317 |
#. type: TQ |
| 318 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 319 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 320 |
#, no-wrap |
| 321 |
msgid "\\&.\\|.\\|." |
| 322 |
msgstr "" |
| 323 |
|
| 324 |
#. type: Plain text |
| 325 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 326 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 327 |
msgid "" |
| 328 |
"Used in conjunction with B<MFD_HUGETLB> to select alternative hugetlb page " |
| 329 |
"sizes (respectively, 2\\ MB, 1\\ GB, ...) on systems that support multiple " |
| 330 |
"hugetlb page sizes. Definitions for known huge page sizes are included in " |
| 331 |
"the header file I<E<lt>linux/memfd.hE<gt>.>" |
| 332 |
msgstr "" |
| 333 |
"Используется как дополнение к B<MFD_HUGETLB> для выбора размера страницы " |
| 334 |
"hugetlb (соответственно, 2\\ МБ, 1\\ ГБ, …) в системах, которые поддерживают " |
| 335 |
"различные размеры страниц hugetlb. Определения размеров огромных страниц " |
| 336 |
"включены в заголовочный файл I<E<lt>linux/memfd.hE<gt>.>" |
| 337 |
|
| 338 |
#. type: Plain text |
| 339 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 340 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 341 |
msgid "" |
| 342 |
"For details on encoding huge page sizes not included in the header file, see " |
| 343 |
"the discussion of the similarly named constants in B<mmap>(2)." |
| 344 |
msgstr "" |
| 345 |
"Дополнительную информацию о кодировании размеров огромных страниц, " |
| 346 |
"отсутствующих в заголовочном файле, смотрите в описании сходных по имени " |
| 347 |
"констант в B<mmap>(2)." |
| 348 |
|
| 349 |
#. type: Plain text |
| 350 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 351 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 352 |
msgid "Unused bits in I<flags> must be 0." |
| 353 |
msgstr "Неиспользуемые биты в I<flags> должны быть равны 0." |
| 354 |
|
| 355 |
#. type: Plain text |
| 356 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 357 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 358 |
msgid "" |
| 359 |
"As its return value, B<memfd_create>() returns a new file descriptor that " |
| 360 |
"can be used to refer to the file. This file descriptor is opened for both " |
| 361 |
"reading and writing (B<O_RDWR>) and B<O_LARGEFILE> is set for the file " |
| 362 |
"descriptor." |
| 363 |
msgstr "" |
| 364 |
"В качестве возвращаемого значения B<memfd_create>() возвращает новый " |
| 365 |
"файловый дескриптор, который можно использовать для обращения к файлу. " |
| 366 |
"Данный файловый дескриптор открыт на чтение и запись (B<O_RDWR>) и в " |
| 367 |
"файловом дескрипторе установлен флаг B<O_LARGEFILE>." |
| 368 |
|
| 369 |
#. type: Plain text |
| 370 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 371 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 372 |
msgid "" |
| 373 |
"With respect to B<fork>(2) and B<execve>(2), the usual semantics apply for " |
| 374 |
"the file descriptor created by B<memfd_create>(). A copy of the file " |
| 375 |
"descriptor is inherited by the child produced by B<fork>(2) and refers to " |
| 376 |
"the same file. The file descriptor is preserved across B<execve>(2), unless " |
| 377 |
"the close-on-exec flag has been set." |
| 378 |
msgstr "" |
| 379 |
"При вызове B<fork>(2) и B<execve>(2) с файловым дескриптором, созданным " |
| 380 |
"B<memfd_create>(), применяется обычная семантика. Копия файлового " |
| 381 |
"дескриптора наследуется потомком, созданным B<fork>(2), указывает на тот же " |
| 382 |
"файл. Файловый дескриптор сохраняется при после B<execve>(2), если не " |
| 383 |
"установлен флаг close-on-exec." |
| 384 |
|
| 385 |
#. type: SH |
| 386 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 387 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 388 |
#, no-wrap |
| 389 |
msgid "RETURN VALUE" |
| 390 |
msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" |
| 391 |
|
| 392 |
#. type: Plain text |
| 393 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 394 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 395 |
msgid "" |
| 396 |
"On success, B<memfd_create>() returns a new file descriptor. On error, -1 " |
| 397 |
"is returned and I<errno> is set to indicate the error." |
| 398 |
msgstr "" |
| 399 |
"При успешном выполнении B<memfd_create>() возвращает новый файловый " |
| 400 |
"дескриптор. При ошибке возвращается -1, и I<errno> устанавливается в " |
| 401 |
"соответствующее значение." |
| 402 |
|
| 403 |
#. type: SH |
| 404 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 405 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 406 |
#, no-wrap |
| 407 |
msgid "ERRORS" |
| 408 |
msgstr "ОШИБКИ" |
| 409 |
|
| 410 |
#. type: TP |
| 411 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 412 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 413 |
#, no-wrap |
| 414 |
msgid "B<EFAULT>" |
| 415 |
msgstr "B<EFAULT>" |
| 416 |
|
| 417 |
#. type: Plain text |
| 418 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 419 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 420 |
msgid "The address in I<name> points to invalid memory." |
| 421 |
msgstr "Некорректный адрес в I<name>." |
| 422 |
|
| 423 |
#. type: TP |
| 424 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 425 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 426 |
#, no-wrap |
| 427 |
msgid "B<EINVAL>" |
| 428 |
msgstr "B<EINVAL>" |
| 429 |
|
| 430 |
#. type: Plain text |
| 431 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 432 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 433 |
msgid "I<flags> included unknown bits." |
| 434 |
msgstr "В I<flags> указаны неизвестные биты." |
| 435 |
|
| 436 |
#. NAME_MAX - strlen("memfd:") |
| 437 |
#. type: Plain text |
| 438 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 439 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 440 |
msgid "" |
| 441 |
"I<name> was too long. (The limit is 249 bytes, excluding the terminating " |
| 442 |
"null byte.)" |
| 443 |
msgstr "" |
| 444 |
"Значение I<name> было слишком длинным (ограничено 249 байтами, не считая " |
| 445 |
"конечный байт null)." |
| 446 |
|
| 447 |
#. type: Plain text |
| 448 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 449 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 450 |
msgid "" |
| 451 |
"Both B<MFD_HUGETLB> and B<MFD_ALLOW_SEALING> were specified in I<flags>." |
| 452 |
msgstr "В I<flags> указаны B<MFD_HUGETLB> и B<MFD_ALLOW_SEALING> одновременно." |
| 453 |
|
| 454 |
#. type: TP |
| 455 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 456 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 457 |
#, no-wrap |
| 458 |
msgid "B<EMFILE>" |
| 459 |
msgstr "B<EMFILE>" |
| 460 |
|
| 461 |
#. type: Plain text |
| 462 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 463 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 464 |
msgid "" |
| 465 |
"The per-process limit on the number of open file descriptors has been " |
| 466 |
"reached." |
| 467 |
msgstr "" |
| 468 |
"Было достигнуто ограничение по количеству открытых файловых дескрипторов на " |
| 469 |
"процесс." |
| 470 |
|
| 471 |
#. type: TP |
| 472 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 473 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 474 |
#, no-wrap |
| 475 |
msgid "B<ENFILE>" |
| 476 |
msgstr "B<ENFILE>" |
| 477 |
|
| 478 |
#. type: Plain text |
| 479 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 480 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 481 |
msgid "" |
| 482 |
"The system-wide limit on the total number of open files has been reached." |
| 483 |
msgstr "Достигнуто максимальное количество открытых файлов в системе." |
| 484 |
|
| 485 |
#. type: TP |
| 486 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 487 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 488 |
#, no-wrap |
| 489 |
msgid "B<ENOMEM>" |
| 490 |
msgstr "B<ENOMEM>" |
| 491 |
|
| 492 |
#. type: Plain text |
| 493 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 494 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 495 |
msgid "There was insufficient memory to create a new anonymous file." |
| 496 |
msgstr "Недостаточно памяти для создания нового анонимного файла." |
| 497 |
|
| 498 |
#. type: TP |
| 499 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 500 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 501 |
#, no-wrap |
| 502 |
msgid "B<EPERM>" |
| 503 |
msgstr "B<EPERM>" |
| 504 |
|
| 505 |
#. type: Plain text |
| 506 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 507 |
#: opensuse-tumbleweed |
| 508 |
msgid "" |
| 509 |
"The B<MFD_HUGETLB> flag was specified, but the caller was not privileged " |
| 510 |
"(did not have the B<CAP_IPC_LOCK> capability) and is not a member of the " |
| 511 |
"I<hugetlb_shm_group> group; see the description of I</proc/sys/vm/" |
| 512 |
"hugetlb_shm_group> in B<proc_sys_vm>(5)." |
| 513 |
msgstr "" |
| 514 |
|
| 515 |
#. type: SH |
| 516 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 517 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 518 |
#, no-wrap |
| 519 |
msgid "STANDARDS" |
| 520 |
msgstr "СТАНДАРТЫ" |
| 521 |
|
| 522 |
#. type: Plain text |
| 523 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 524 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 525 |
msgid "Linux." |
| 526 |
msgstr "Linux." |
| 527 |
|
| 528 |
#. type: SH |
| 529 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 530 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 531 |
#, no-wrap |
| 532 |
msgid "HISTORY" |
| 533 |
msgstr "ИСТОРИЯ" |
| 534 |
|
| 535 |
#. type: Plain text |
| 536 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 537 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 538 |
#, fuzzy |
| 539 |
#| msgid "Since glibc 2.2.2:" |
| 540 |
msgid "Linux 3.17, glibc 2.27." |
| 541 |
msgstr "Начиная с glibc 2.2.2:" |
| 542 |
|
| 543 |
#. type: SH |
| 544 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 545 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 546 |
#, no-wrap |
| 547 |
msgid "NOTES" |
| 548 |
msgstr "ПРИМЕЧАНИЯ" |
| 549 |
|
| 550 |
#. See also http://lwn.net/Articles/593918/ |
| 551 |
#. and http://lwn.net/Articles/594919/ and http://lwn.net/Articles/591108/ |
| 552 |
#. type: Plain text |
| 553 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 554 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 555 |
msgid "" |
| 556 |
"The B<memfd_create>() system call provides a simple alternative to manually " |
| 557 |
"mounting a B<tmpfs>(5) filesystem and creating and opening a file in that " |
| 558 |
"filesystem. The primary purpose of B<memfd_create>() is to create files " |
| 559 |
"and associated file descriptors that are used with the file-sealing APIs " |
| 560 |
"provided by B<fcntl>(2)." |
| 561 |
msgstr "" |
| 562 |
"Системный вызов B<memfd_create>() предоставляет простую альтернативу ручному " |
| 563 |
"монтированию файловой системы B<tmpfs>(5), созданию и открытию файла в этой " |
| 564 |
"файловой системе. Основным предназначением B<memfd_create>() является " |
| 565 |
"создание файлов и соответствующих файловых дескрипторов, которые " |
| 566 |
"используются с программным интерфейсом опечатывания файлов, предоставляемым " |
| 567 |
"B<fcntl>(2)." |
| 568 |
|
| 569 |
#. type: Plain text |
| 570 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 571 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 572 |
msgid "" |
| 573 |
"The B<memfd_create>() system call also has uses without file sealing (which " |
| 574 |
"is why file-sealing is disabled, unless explicitly requested with the " |
| 575 |
"B<MFD_ALLOW_SEALING> flag). In particular, it can be used as an alternative " |
| 576 |
"to creating files in I<tmp> or as an alternative to using the B<open>(2) " |
| 577 |
"B<O_TMPFILE> in cases where there is no intention to actually link the " |
| 578 |
"resulting file into the filesystem." |
| 579 |
msgstr "" |
| 580 |
"Системный вызов B<memfd_create>() также используется и без опечатывания " |
| 581 |
"файла (вот почему опечатывание файлов отключено, если этого не запросить " |
| 582 |
"явно с помощью флага B<MFD_ALLOW_SEALING>). В частности, он может " |
| 583 |
"использоваться как альтернатива созданию файлов в I<tmp> или использованию " |
| 584 |
"B<open>(2) с B<O_TMPFILE> в случаях, когда не требуется реальная ссылка на " |
| 585 |
"конечный файл в файловой системе." |
| 586 |
|
| 587 |
#. type: SS |
| 588 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 589 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 590 |
#, no-wrap |
| 591 |
msgid "File sealing" |
| 592 |
msgstr "Опечатывание файла (file sealing)" |
| 593 |
|
| 594 |
#. type: Plain text |
| 595 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 596 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 597 |
msgid "" |
| 598 |
"In the absence of file sealing, processes that communicate via shared memory " |
| 599 |
"must either trust each other, or take measures to deal with the possibility " |
| 600 |
"that an untrusted peer may manipulate the shared memory region in " |
| 601 |
"problematic ways. For example, an untrusted peer might modify the contents " |
| 602 |
"of the shared memory at any time, or shrink the shared memory region. The " |
| 603 |
"former possibility leaves the local process vulnerable to time-of-check-to-" |
| 604 |
"time-of-use race conditions (typically dealt with by copying data from the " |
| 605 |
"shared memory region before checking and using it). The latter possibility " |
| 606 |
"leaves the local process vulnerable to B<SIGBUS> signals when an attempt is " |
| 607 |
"made to access a now-nonexistent location in the shared memory region. " |
| 608 |
"(Dealing with this possibility necessitates the use of a handler for the " |
| 609 |
"B<SIGBUS> signal.)" |
| 610 |
msgstr "" |
| 611 |
"Ели файл не опечатан, то процессы, которые связываются через общую память, " |
| 612 |
"должны или доверять друг другу, или учитывать возможность того, что " |
| 613 |
"недоверенная сторона может работать с общей памятью проблемным способом. " |
| 614 |
"Например, недоверенная сторона может изменить содержимое общей памяти в " |
| 615 |
"любое время или уменьшить область общей памяти. Первая возможность делает " |
| 616 |
"локальный процесс уязвимым к состязательности условий «момент проверки — " |
| 617 |
"момент использования» (обычно решается копированием данных из области общей " |
| 618 |
"памяти перед проверкой и использованием). Последняя возможность делает " |
| 619 |
"локальный процесс уязвимым к сигналам B<SIGBUS>, которые возникают при " |
| 620 |
"попытке получить доступ к теперь несуществующему расположению в области " |
| 621 |
"общей памяти (решается использованием обработчика сигнала B<SIGBUS>)." |
| 622 |
|
| 623 |
#. type: Plain text |
| 624 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 625 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 626 |
msgid "" |
| 627 |
"Dealing with untrusted peers imposes extra complexity on code that employs " |
| 628 |
"shared memory. Memory sealing enables that extra complexity to be " |
| 629 |
"eliminated, by allowing a process to operate secure in the knowledge that " |
| 630 |
"its peer can't modify the shared memory in an undesired fashion." |
| 631 |
msgstr "" |
| 632 |
"Взаимодействие с недоверенными сторонами приводит к усложнению кода для " |
| 633 |
"работы с общей памятью. Опечатывание памяти позволяет устранить эту " |
| 634 |
"сложность, позволяя процессу безопасно работать, зная что его партнёр не " |
| 635 |
"может изменить общую память нежелательным способом." |
| 636 |
|
| 637 |
#. type: Plain text |
| 638 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 639 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 640 |
msgid "An example of the usage of the sealing mechanism is as follows:" |
| 641 |
msgstr "В примере использования механизма опечатывания происходит следующее:" |
| 642 |
|
| 643 |
#. type: IP |
| 644 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 645 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 646 |
#, no-wrap |
| 647 |
msgid "(1)" |
| 648 |
msgstr "(1)" |
| 649 |
|
| 650 |
#. type: Plain text |
| 651 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 652 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 653 |
msgid "" |
| 654 |
"The first process creates a B<tmpfs>(5) file using B<memfd_create>(). The " |
| 655 |
"call yields a file descriptor used in subsequent steps." |
| 656 |
msgstr "" |
| 657 |
"Первый процесс создаёт файл B<tmpfs>(5) с помощью B<memfd_create>(). Вызов " |
| 658 |
"возвращает файловый дескриптор, используемый далее." |
| 659 |
|
| 660 |
#. type: IP |
| 661 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 662 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 663 |
#, no-wrap |
| 664 |
msgid "(2)" |
| 665 |
msgstr "(2)" |
| 666 |
|
| 667 |
#. type: Plain text |
| 668 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 669 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 670 |
msgid "" |
| 671 |
"The first process sizes the file created in the previous step using " |
| 672 |
"B<ftruncate>(2), maps it using B<mmap>(2), and populates the shared memory " |
| 673 |
"with the desired data." |
| 674 |
msgstr "" |
| 675 |
"Первый процесс задаёт размер файла, созданного ранее, с помощью " |
| 676 |
"B<ftruncate>(2), отображает его с помощью B<mmap>(2) и заполняется общую " |
| 677 |
"память нужными данными." |
| 678 |
|
| 679 |
#. type: IP |
| 680 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 681 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 682 |
#, no-wrap |
| 683 |
msgid "(3)" |
| 684 |
msgstr "(3)" |
| 685 |
|
| 686 |
#. type: Plain text |
| 687 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 688 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 689 |
#, fuzzy |
| 690 |
#| msgid "" |
| 691 |
#| "The first process uses the B<fcntl>(2) B<F_ADD_SEALS> operation to place " |
| 692 |
#| "one or more seals on the file, in order to restrict further modifications " |
| 693 |
#| "on the file. (If placing the seal B<F_SEAL_WRITE>, then it will be " |
| 694 |
#| "necessary to first unmap the shared writable mapping created in the " |
| 695 |
#| "previous step.)" |
| 696 |
msgid "" |
| 697 |
"The first process uses the B<fcntl>(2) B<F_ADD_SEALS> operation to place " |
| 698 |
"one or more seals on the file, in order to restrict further modifications on " |
| 699 |
"the file. (If placing the seal B<F_SEAL_WRITE>, then it will be necessary " |
| 700 |
"to first unmap the shared writable mapping created in the previous step. " |
| 701 |
"Otherwise, behavior similar to B<F_SEAL_WRITE> can be achieved by using " |
| 702 |
"B<F_SEAL_FUTURE_WRITE>, which will prevent future writes via B<mmap>(2) and " |
| 703 |
"B<write>(2) from succeeding while keeping existing shared writable " |
| 704 |
"mappings)." |
| 705 |
msgstr "" |
| 706 |
"Первый процесс использует B<fcntl>(2) с операцией B<F_ADD_SEALS> для " |
| 707 |
"установки одной или более печатей на файл, чтобы в дальнейшем ограничить " |
| 708 |
"изменение файла (если устанавливается печать B<F_SEAL_WRITE>, то сначала " |
| 709 |
"нужно удалить общее доступное на запись отображение, созданное ранее)." |
| 710 |
|
| 711 |
#. type: IP |
| 712 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 713 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 714 |
#, no-wrap |
| 715 |
msgid "(4)" |
| 716 |
msgstr "(4)" |
| 717 |
|
| 718 |
#. type: Plain text |
| 719 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 720 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 721 |
msgid "" |
| 722 |
"A second process obtains a file descriptor for the B<tmpfs>(5) file and " |
| 723 |
"maps it. Among the possible ways in which this could happen are the " |
| 724 |
"following:" |
| 725 |
msgstr "" |
| 726 |
"Второй процесс получает файловый дескриптор файла B<tmpfs>(5) и отображает " |
| 727 |
"его. Варианты того, как это можно сделать:" |
| 728 |
|
| 729 |
#. type: IP |
| 730 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 731 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 732 |
#, no-wrap |
| 733 |
msgid "\\[bu]" |
| 734 |
msgstr "\\[bu]" |
| 735 |
|
| 736 |
#. type: Plain text |
| 737 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 738 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 739 |
msgid "" |
| 740 |
"The process that called B<memfd_create>() could transfer the resulting file " |
| 741 |
"descriptor to the second process via a UNIX domain socket (see B<unix>(7) " |
| 742 |
"and B<cmsg>(3)). The second process then maps the file using B<mmap>(2)." |
| 743 |
msgstr "" |
| 744 |
"Процесс, вызвавший B<memfd_create>(), может переслать полученный файловый " |
| 745 |
"дескриптор второму процессу через доменный сокет UNIX (смотрите B<unix>(7) и " |
| 746 |
"B<cmsg>(3)). Второй процесс затем отображает файл с помощью B<mmap>(2)." |
| 747 |
|
| 748 |
#. type: Plain text |
| 749 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 750 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 751 |
msgid "" |
| 752 |
"The second process is created via B<fork>(2) and thus automatically " |
| 753 |
"inherits the file descriptor and mapping. (Note that in this case and the " |
| 754 |
"next, there is a natural trust relationship between the two processes, since " |
| 755 |
"they are running under the same user ID. Therefore, file sealing would not " |
| 756 |
"normally be necessary.)" |
| 757 |
msgstr "" |
| 758 |
"Второй процесс создаётся с помощью B<fork>(2) и, таким образом, наследует " |
| 759 |
"файловый дескриптор и отображение (заметим, что в этом случае и следующем " |
| 760 |
"образуется природное доверие между двумя процессами, так как они работают с " |
| 761 |
"правами одного пользовательского идентификатора. Поэтому опечатывание файла " |
| 762 |
"здесь не нужно)." |
| 763 |
|
| 764 |
#. type: Plain text |
| 765 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 766 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 767 |
#, fuzzy |
| 768 |
#| msgid "" |
| 769 |
#| "The second process opens the file I</proc/E<lt>pidE<gt>/fd/E<lt>fdE<gt>>, " |
| 770 |
#| "where I<E<lt>pidE<gt>> is the PID of the first process (the one that " |
| 771 |
#| "called B<memfd_create>()), and I<E<lt>fdE<gt>> is the number of the file " |
| 772 |
#| "descriptor returned by the call to B<memfd_create>() in that process. " |
| 773 |
#| "The second process then maps the file using B<mmap>(2)." |
| 774 |
msgid "" |
| 775 |
"The second process opens the file I</proc/>pidI</fd/>fd, where " |
| 776 |
"I<E<lt>pidE<gt>> is the PID of the first process (the one that called " |
| 777 |
"B<memfd_create>()), and I<E<lt>fdE<gt>> is the number of the file descriptor " |
| 778 |
"returned by the call to B<memfd_create>() in that process. The second " |
| 779 |
"process then maps the file using B<mmap>(2)." |
| 780 |
msgstr "" |
| 781 |
"Второй процесс открывает файл I</proc/E<lt>pidE<gt>/fd/E<lt>fdE<gt>>, где " |
| 782 |
"I<E<lt>pidE<gt>> — PID первого процесса (вызвавшего B<memfd_create>()), а " |
| 783 |
"I<E<lt>fdE<gt>> — номер файлового дескриптора, возвращённого вызовом " |
| 784 |
"B<memfd_create>() в этом процессе. Затем второй процесс отображает файл с " |
| 785 |
"помощью B<mmap>(2)." |
| 786 |
|
| 787 |
#. type: IP |
| 788 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 789 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 790 |
#, no-wrap |
| 791 |
msgid "(5)" |
| 792 |
msgstr "(5)" |
| 793 |
|
| 794 |
#. type: Plain text |
| 795 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 796 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 797 |
msgid "" |
| 798 |
"The second process uses the B<fcntl>(2) B<F_GET_SEALS> operation to " |
| 799 |
"retrieve the bit mask of seals that has been applied to the file. This bit " |
| 800 |
"mask can be inspected in order to determine what kinds of restrictions have " |
| 801 |
"been placed on file modifications. If desired, the second process can apply " |
| 802 |
"further seals to impose additional restrictions (so long as the " |
| 803 |
"B<F_SEAL_SEAL> seal has not yet been applied)." |
| 804 |
msgstr "" |
| 805 |
"Второй процесс использует B<fcntl>(2) с операцией B<F_GET_SEALS> для " |
| 806 |
"получения битовой маски печатей, которые были применены к файлу. Данная " |
| 807 |
"маска проверяется, чтобы определить какие ограничения наложены на изменения " |
| 808 |
"файла. Если требуется, то второй процесс может наложить дополнительные " |
| 809 |
"печати, что ещё ограничить действия (возможно до тех пор, пока не будет " |
| 810 |
"наложена печать B<F_SEAL_SEAL>)." |
| 811 |
|
| 812 |
#. type: SH |
| 813 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 814 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 815 |
#, no-wrap |
| 816 |
msgid "EXAMPLES" |
| 817 |
msgstr "ПРИМЕРЫ" |
| 818 |
|
| 819 |
#. type: Plain text |
| 820 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 821 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 822 |
msgid "" |
| 823 |
"Below are shown two example programs that demonstrate the use of " |
| 824 |
"B<memfd_create>() and the file sealing API." |
| 825 |
msgstr "" |
| 826 |
"Далее показано два примера программы, в которых продемонстрировано " |
| 827 |
"использование B<memfd_create>() и программный интерфейс опечатывания файла." |
| 828 |
|
| 829 |
#. type: Plain text |
| 830 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 831 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 832 |
msgid "" |
| 833 |
"The first program, I<t_memfd_create.c>, creates a B<tmpfs>(5) file using " |
| 834 |
"B<memfd_create>(), sets a size for the file, maps it into memory, and " |
| 835 |
"optionally places some seals on the file. The program accepts up to three " |
| 836 |
"command-line arguments, of which the first two are required. The first " |
| 837 |
"argument is the name to associate with the file, the second argument is the " |
| 838 |
"size to be set for the file, and the optional third argument is a string of " |
| 839 |
"characters that specify seals to be set on the file." |
| 840 |
msgstr "" |
| 841 |
"Первая программа, I<t_memfd_create.c>, создаёт файл B<tmpfs>(5) с помощью " |
| 842 |
"B<memfd_create>(), изменяет его размер, отображает в память и, возможно, " |
| 843 |
"накладывает несколько печатей на файл. Программа принимает не более трёх " |
| 844 |
"аргументов командной строки, два первых обязательные. Первым аргументом " |
| 845 |
"задаётся имя файла, во втором — размер файла, а в необязательном третьем — " |
| 846 |
"строка символов, задающих устанавливаемые печати на файл." |
| 847 |
|
| 848 |
#. type: Plain text |
| 849 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 850 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 851 |
msgid "" |
| 852 |
"The second program, I<t_get_seals.c>, can be used to open an existing file " |
| 853 |
"that was created via B<memfd_create>() and inspect the set of seals that " |
| 854 |
"have been applied to that file." |
| 855 |
msgstr "" |
| 856 |
"Вторая программа, I<t_get_seals.c>, может использоваться для открытия " |
| 857 |
"существующего файла, созданного B<memfd_create>(), и проверки набора " |
| 858 |
"печатей, применённых к файлу." |
| 859 |
|
| 860 |
#. type: Plain text |
| 861 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 862 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 863 |
msgid "" |
| 864 |
"The following shell session demonstrates the use of these programs. First " |
| 865 |
"we create a B<tmpfs>(5) file and set some seals on it:" |
| 866 |
msgstr "" |
| 867 |
"Следующий пример сеанса показывает как использовать программу. Сначала " |
| 868 |
"создаётся файл B<tmpfs>(5) и накладываются печати:" |
| 869 |
|
| 870 |
#. type: Plain text |
| 871 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 872 |
#: opensuse-tumbleweed |
| 873 |
#, fuzzy, no-wrap |
| 874 |
#| msgid "" |
| 875 |
#| "$ B<./t_memfd_create my_memfd_file 4096 sw &>\n" |
| 876 |
#| "[1] 11775\n" |
| 877 |
#| "PID: 11775; fd: 3; /proc/11775/fd/3\n" |
| 878 |
msgid "" |
| 879 |
"$B< ./t_memfd_create my_memfd_file 4096 sw &>\n" |
| 880 |
"[1] 11775\n" |
| 881 |
"PID: 11775;\\& fd: 3;\\& /proc/11775/fd/3\n" |
| 882 |
msgstr "" |
| 883 |
"$ B<./t_memfd_create my_memfd_file 4096 sw &>\n" |
| 884 |
"[1] 11775\n" |
| 885 |
"PID: 11775; fd: 3; /proc/11775/fd/3\n" |
| 886 |
|
| 887 |
#. type: Plain text |
| 888 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 889 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 890 |
msgid "" |
| 891 |
"At this point, the I<t_memfd_create> program continues to run in the " |
| 892 |
"background. From another program, we can obtain a file descriptor for the " |
| 893 |
"file created by B<memfd_create>() by opening the I</proc/>pidI</fd> file " |
| 894 |
"that corresponds to the file descriptor opened by B<memfd_create>(). Using " |
| 895 |
"that pathname, we inspect the content of the I</proc/>pidI</fd> symbolic " |
| 896 |
"link, and use our I<t_get_seals> program to view the seals that have been " |
| 897 |
"placed on the file:" |
| 898 |
msgstr "" |
| 899 |
"После этого программа I<t_memfd_create> продолжает выполняться в фоновом " |
| 900 |
"режиме. Из другой программы можно получить дескриптор файла, созданный " |
| 901 |
"B<memfd_create>(), открыв файл I</proc/>pidI</fd>, который соответствует " |
| 902 |
"файловому дескриптору, открытому B<memfd_create>(). Используя это имя, можно " |
| 903 |
"просмотреть содержимое символьной ссылки I</proc/>pidI</fd> и использовать " |
| 904 |
"программу I<t_get_seals> для просмотра печатей, которые установлены на файл:" |
| 905 |
|
| 906 |
#. type: Plain text |
| 907 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 908 |
#: opensuse-tumbleweed |
| 909 |
#, fuzzy, no-wrap |
| 910 |
#| msgid "" |
| 911 |
#| "$ B<readlink /proc/11775/fd/3>\n" |
| 912 |
#| "/memfd:my_memfd_file (deleted)\n" |
| 913 |
#| "$ B<./t_get_seals /proc/11775/fd/3>\n" |
| 914 |
#| "Existing seals: WRITE SHRINK\n" |
| 915 |
msgid "" |
| 916 |
"$B< readlink /proc/11775/fd/3>;\n" |
| 917 |
"/memfd:my_memfd_file (deleted)\n" |
| 918 |
"$B< ./t_get_seals /proc/11775/fd/3>;\n" |
| 919 |
"Existing seals: WRITE SHRINK\n" |
| 920 |
msgstr "" |
| 921 |
"$ B<readlink /proc/11775/fd/3>\n" |
| 922 |
"/memfd:my_memfd_file (удалён)\n" |
| 923 |
"$ B<./t_get_seals /proc/11775/fd/3>\n" |
| 924 |
"Наложенные печати: WRITE SHRINK\n" |
| 925 |
|
| 926 |
#. type: SS |
| 927 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 928 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 929 |
#, no-wrap |
| 930 |
msgid "Program source: t_memfd_create.c" |
| 931 |
msgstr "Исходный код программы: t_memfd_create.c" |
| 932 |
|
| 933 |
#. type: Plain text |
| 934 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 935 |
#: opensuse-tumbleweed |
| 936 |
#, no-wrap |
| 937 |
msgid "" |
| 938 |
"#define _GNU_SOURCE\n" |
| 939 |
"#include E<lt>err.hE<gt>\n" |
| 940 |
"#include E<lt>fcntl.hE<gt>\n" |
| 941 |
"#include E<lt>stdint.hE<gt>\n" |
| 942 |
"#include E<lt>stdio.hE<gt>\n" |
| 943 |
"#include E<lt>stdlib.hE<gt>\n" |
| 944 |
"#include E<lt>string.hE<gt>\n" |
| 945 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 946 |
"#include E<lt>sys/types.hE<gt>\n" |
| 947 |
"#include E<lt>unistd.hE<gt>\n" |
| 948 |
"\\&\n" |
| 949 |
"int\n" |
| 950 |
"main(int argc, char *argv[])\n" |
| 951 |
"{\n" |
| 952 |
" int fd;\n" |
| 953 |
" char *name, *seals_arg;\n" |
| 954 |
" ssize_t size;\n" |
| 955 |
" unsigned int seals;\n" |
| 956 |
"\\&\n" |
| 957 |
" if (argc E<lt> 3) {\n" |
| 958 |
" fprintf(stderr, \"%s name size [seals]\\[rs]n\", argv[0]);\n" |
| 959 |
" fprintf(stderr, \"\\[rs]t\\[aq]seals\\[aq] can contain any of the \"\n" |
| 960 |
" \"following characters:\\[rs]n\");\n" |
| 961 |
" fprintf(stderr, \"\\[rs]t\\[rs]tg - F_SEAL_GROW\\[rs]n\");\n" |
| 962 |
" fprintf(stderr, \"\\[rs]t\\[rs]ts - F_SEAL_SHRINK\\[rs]n\");\n" |
| 963 |
" fprintf(stderr, \"\\[rs]t\\[rs]tw - F_SEAL_WRITE\\[rs]n\");\n" |
| 964 |
" fprintf(stderr, \"\\[rs]t\\[rs]tW - F_SEAL_FUTURE_WRITE\\[rs]n\");\n" |
| 965 |
" fprintf(stderr, \"\\[rs]t\\[rs]tS - F_SEAL_SEAL\\[rs]n\");\n" |
| 966 |
" exit(EXIT_FAILURE);\n" |
| 967 |
" }\n" |
| 968 |
"\\&\n" |
| 969 |
" name = argv[1];\n" |
| 970 |
" size = atoi(argv[2]);\n" |
| 971 |
" seals_arg = argv[3];\n" |
| 972 |
"\\&\n" |
| 973 |
" /* Create an anonymous file in tmpfs; allow seals to be\n" |
| 974 |
" placed on the file. */\n" |
| 975 |
"\\&\n" |
| 976 |
" fd = memfd_create(name, MFD_ALLOW_SEALING);\n" |
| 977 |
" if (fd == -1)\n" |
| 978 |
" err(EXIT_FAILURE, \"memfd_create\");\n" |
| 979 |
"\\&\n" |
| 980 |
" /* Size the file as specified on the command line. */\n" |
| 981 |
"\\&\n" |
| 982 |
" if (ftruncate(fd, size) == -1)\n" |
| 983 |
" err(EXIT_FAILURE, \"truncate\");\n" |
| 984 |
"\\&\n" |
| 985 |
" printf(\"PID: %jd; fd: %d; /proc/%jd/fd/%d\\[rs]n\",\n" |
| 986 |
" (intmax_t) getpid(), fd, (intmax_t) getpid(), fd);\n" |
| 987 |
"\\&\n" |
| 988 |
" /* Code to map the file and populate the mapping with data\n" |
| 989 |
" omitted. */\n" |
| 990 |
"\\&\n" |
| 991 |
" /* If a \\[aq]seals\\[aq] command-line argument was supplied, set some\n" |
| 992 |
" seals on the file. */\n" |
| 993 |
"\\&\n" |
| 994 |
" if (seals_arg != NULL) {\n" |
| 995 |
" seals = 0;\n" |
| 996 |
"\\&\n" |
| 997 |
" if (strchr(seals_arg, \\[aq]g\\[aq]) != NULL)\n" |
| 998 |
" seals |= F_SEAL_GROW;\n" |
| 999 |
" if (strchr(seals_arg, \\[aq]s\\[aq]) != NULL)\n" |
| 1000 |
" seals |= F_SEAL_SHRINK;\n" |
| 1001 |
" if (strchr(seals_arg, \\[aq]w\\[aq]) != NULL)\n" |
| 1002 |
" seals |= F_SEAL_WRITE;\n" |
| 1003 |
" if (strchr(seals_arg, \\[aq]W\\[aq]) != NULL)\n" |
| 1004 |
" seals |= F_SEAL_FUTURE_WRITE;\n" |
| 1005 |
" if (strchr(seals_arg, \\[aq]S\\[aq]) != NULL)\n" |
| 1006 |
" seals |= F_SEAL_SEAL;\n" |
| 1007 |
"\\&\n" |
| 1008 |
" if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n" |
| 1009 |
" err(EXIT_FAILURE, \"fcntl\");\n" |
| 1010 |
" }\n" |
| 1011 |
"\\&\n" |
| 1012 |
" /* Keep running, so that the file created by memfd_create()\n" |
| 1013 |
" continues to exist. */\n" |
| 1014 |
"\\&\n" |
| 1015 |
" pause();\n" |
| 1016 |
"\\&\n" |
| 1017 |
" exit(EXIT_SUCCESS);\n" |
| 1018 |
"}\n" |
| 1019 |
msgstr "" |
| 1020 |
|
| 1021 |
#. SRC END |
| 1022 |
#. type: SS |
| 1023 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1024 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1025 |
#, no-wrap |
| 1026 |
msgid "Program source: t_get_seals.c" |
| 1027 |
msgstr "Исходный код программы: t_get_seals.c" |
| 1028 |
|
| 1029 |
#. type: Plain text |
| 1030 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 1031 |
#: opensuse-tumbleweed |
| 1032 |
#, no-wrap |
| 1033 |
msgid "" |
| 1034 |
"#define _GNU_SOURCE\n" |
| 1035 |
"#include E<lt>err.hE<gt>\n" |
| 1036 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1037 |
"#include E<lt>stdio.hE<gt>\n" |
| 1038 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1039 |
"\\&\n" |
| 1040 |
"int\n" |
| 1041 |
"main(int argc, char *argv[])\n" |
| 1042 |
"{\n" |
| 1043 |
" int fd;\n" |
| 1044 |
" unsigned int seals;\n" |
| 1045 |
"\\&\n" |
| 1046 |
" if (argc != 2) {\n" |
| 1047 |
" fprintf(stderr, \"%s /proc/PID/fd/FD\\[rs]n\", argv[0]);\n" |
| 1048 |
" exit(EXIT_FAILURE);\n" |
| 1049 |
" }\n" |
| 1050 |
"\\&\n" |
| 1051 |
" fd = open(argv[1], O_RDWR);\n" |
| 1052 |
" if (fd == -1)\n" |
| 1053 |
" err(EXIT_FAILURE, \"open\");\n" |
| 1054 |
"\\&\n" |
| 1055 |
" seals = fcntl(fd, F_GET_SEALS);\n" |
| 1056 |
" if (seals == -1)\n" |
| 1057 |
" err(EXIT_FAILURE, \"fcntl\");\n" |
| 1058 |
"\\&\n" |
| 1059 |
" printf(\"Existing seals:\");\n" |
| 1060 |
" if (seals & F_SEAL_SEAL)\n" |
| 1061 |
" printf(\" SEAL\");\n" |
| 1062 |
" if (seals & F_SEAL_GROW)\n" |
| 1063 |
" printf(\" GROW\");\n" |
| 1064 |
" if (seals & F_SEAL_WRITE)\n" |
| 1065 |
" printf(\" WRITE\");\n" |
| 1066 |
" if (seals & F_SEAL_FUTURE_WRITE)\n" |
| 1067 |
" printf(\" FUTURE_WRITE\");\n" |
| 1068 |
" if (seals & F_SEAL_SHRINK)\n" |
| 1069 |
" printf(\" SHRINK\");\n" |
| 1070 |
" printf(\"\\[rs]n\");\n" |
| 1071 |
"\\&\n" |
| 1072 |
" /* Code to map the file and access the contents of the\n" |
| 1073 |
" resulting mapping omitted. */\n" |
| 1074 |
"\\&\n" |
| 1075 |
" exit(EXIT_SUCCESS);\n" |
| 1076 |
"}\n" |
| 1077 |
msgstr "" |
| 1078 |
|
| 1079 |
#. SRC END |
| 1080 |
#. type: SH |
| 1081 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1082 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1083 |
#, no-wrap |
| 1084 |
msgid "SEE ALSO" |
| 1085 |
msgstr "СМОТРИТЕ ТАКЖЕ" |
| 1086 |
|
| 1087 |
#. type: Plain text |
| 1088 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1089 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1090 |
msgid "" |
| 1091 |
"B<fcntl>(2), B<ftruncate>(2), B<memfd_secret>(2), B<mmap>(2), B<shmget>(2), " |
| 1092 |
"B<shm_open>(3)" |
| 1093 |
msgstr "" |
| 1094 |
"B<fcntl>(2), B<ftruncate>(2), B<memfd_secret>(2), B<mmap>(2), B<shmget>(2), " |
| 1095 |
"B<shm_open>(3)" |
| 1096 |
|
| 1097 |
#. type: TH |
| 1098 |
#: debian-trixie |
| 1099 |
#, no-wrap |
| 1100 |
msgid "2024-06-15" |
| 1101 |
msgstr "15 июня 2024 г." |
| 1102 |
|
| 1103 |
#. type: TH |
| 1104 |
#: debian-trixie |
| 1105 |
#, no-wrap |
| 1106 |
msgid "Linux man-pages 6.9.1" |
| 1107 |
msgstr "Страницы руководства Linux 6.9.1" |
| 1108 |
|
| 1109 |
#. type: Plain text |
| 1110 |
#: debian-trixie |
| 1111 |
msgid "Standard C library (I<libc>, I<-lc>)" |
| 1112 |
msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)" |
| 1113 |
|
| 1114 |
#. type: Plain text |
| 1115 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1116 |
msgid "" |
| 1117 |
"The B<MFD_HUGETLB> flag was specified, but the caller was not privileged " |
| 1118 |
"(did not have the B<CAP_IPC_LOCK> capability) and is not a member of the " |
| 1119 |
"I<sysctl_hugetlb_shm_group> group; see the description of I</proc/sys/vm/" |
| 1120 |
"sysctl_hugetlb_shm_group> in B<proc>(5)." |
| 1121 |
msgstr "" |
| 1122 |
|
| 1123 |
#. type: Plain text |
| 1124 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1125 |
#, no-wrap |
| 1126 |
msgid "" |
| 1127 |
"$ B<./t_memfd_create my_memfd_file 4096 sw &>\n" |
| 1128 |
"[1] 11775\n" |
| 1129 |
"PID: 11775; fd: 3; /proc/11775/fd/3\n" |
| 1130 |
msgstr "" |
| 1131 |
"$ B<./t_memfd_create my_memfd_file 4096 sw &>\n" |
| 1132 |
"[1] 11775\n" |
| 1133 |
"PID: 11775; fd: 3; /proc/11775/fd/3\n" |
| 1134 |
|
| 1135 |
#. type: Plain text |
| 1136 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1137 |
#, no-wrap |
| 1138 |
msgid "" |
| 1139 |
"$ B<readlink /proc/11775/fd/3>\n" |
| 1140 |
"/memfd:my_memfd_file (deleted)\n" |
| 1141 |
"$ B<./t_get_seals /proc/11775/fd/3>\n" |
| 1142 |
"Existing seals: WRITE SHRINK\n" |
| 1143 |
msgstr "" |
| 1144 |
"$ B<readlink /proc/11775/fd/3>\n" |
| 1145 |
"/memfd:my_memfd_file (удалён)\n" |
| 1146 |
"$ B<./t_get_seals /proc/11775/fd/3>\n" |
| 1147 |
"Наложенные печати: WRITE SHRINK\n" |
| 1148 |
|
| 1149 |
#. type: Plain text |
| 1150 |
#: debian-trixie |
| 1151 |
#, no-wrap |
| 1152 |
msgid "" |
| 1153 |
"#define _GNU_SOURCE\n" |
| 1154 |
"#include E<lt>err.hE<gt>\n" |
| 1155 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1156 |
"#include E<lt>stdint.hE<gt>\n" |
| 1157 |
"#include E<lt>stdio.hE<gt>\n" |
| 1158 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1159 |
"#include E<lt>string.hE<gt>\n" |
| 1160 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1161 |
"#include E<lt>sys/types.hE<gt>\n" |
| 1162 |
"#include E<lt>unistd.hE<gt>\n" |
| 1163 |
"\\&\n" |
| 1164 |
"int\n" |
| 1165 |
"main(int argc, char *argv[])\n" |
| 1166 |
"{\n" |
| 1167 |
" int fd;\n" |
| 1168 |
" char *name, *seals_arg;\n" |
| 1169 |
" ssize_t len;\n" |
| 1170 |
" unsigned int seals;\n" |
| 1171 |
"\\&\n" |
| 1172 |
" if (argc E<lt> 3) {\n" |
| 1173 |
" fprintf(stderr, \"%s name size [seals]\\[rs]n\", argv[0]);\n" |
| 1174 |
" fprintf(stderr, \"\\[rs]t\\[aq]seals\\[aq] can contain any of the \"\n" |
| 1175 |
" \"following characters:\\[rs]n\");\n" |
| 1176 |
" fprintf(stderr, \"\\[rs]t\\[rs]tg - F_SEAL_GROW\\[rs]n\");\n" |
| 1177 |
" fprintf(stderr, \"\\[rs]t\\[rs]ts - F_SEAL_SHRINK\\[rs]n\");\n" |
| 1178 |
" fprintf(stderr, \"\\[rs]t\\[rs]tw - F_SEAL_WRITE\\[rs]n\");\n" |
| 1179 |
" fprintf(stderr, \"\\[rs]t\\[rs]tW - F_SEAL_FUTURE_WRITE\\[rs]n\");\n" |
| 1180 |
" fprintf(stderr, \"\\[rs]t\\[rs]tS - F_SEAL_SEAL\\[rs]n\");\n" |
| 1181 |
" exit(EXIT_FAILURE);\n" |
| 1182 |
" }\n" |
| 1183 |
"\\&\n" |
| 1184 |
" name = argv[1];\n" |
| 1185 |
" len = atoi(argv[2]);\n" |
| 1186 |
" seals_arg = argv[3];\n" |
| 1187 |
"\\&\n" |
| 1188 |
" /* Create an anonymous file in tmpfs; allow seals to be\n" |
| 1189 |
" placed on the file. */\n" |
| 1190 |
"\\&\n" |
| 1191 |
" fd = memfd_create(name, MFD_ALLOW_SEALING);\n" |
| 1192 |
" if (fd == -1)\n" |
| 1193 |
" err(EXIT_FAILURE, \"memfd_create\");\n" |
| 1194 |
"\\&\n" |
| 1195 |
" /* Size the file as specified on the command line. */\n" |
| 1196 |
"\\&\n" |
| 1197 |
" if (ftruncate(fd, len) == -1)\n" |
| 1198 |
" err(EXIT_FAILURE, \"truncate\");\n" |
| 1199 |
"\\&\n" |
| 1200 |
" printf(\"PID: %jd; fd: %d; /proc/%jd/fd/%d\\[rs]n\",\n" |
| 1201 |
" (intmax_t) getpid(), fd, (intmax_t) getpid(), fd);\n" |
| 1202 |
"\\&\n" |
| 1203 |
" /* Code to map the file and populate the mapping with data\n" |
| 1204 |
" omitted. */\n" |
| 1205 |
"\\&\n" |
| 1206 |
" /* If a \\[aq]seals\\[aq] command-line argument was supplied, set some\n" |
| 1207 |
" seals on the file. */\n" |
| 1208 |
"\\&\n" |
| 1209 |
" if (seals_arg != NULL) {\n" |
| 1210 |
" seals = 0;\n" |
| 1211 |
"\\&\n" |
| 1212 |
" if (strchr(seals_arg, \\[aq]g\\[aq]) != NULL)\n" |
| 1213 |
" seals |= F_SEAL_GROW;\n" |
| 1214 |
" if (strchr(seals_arg, \\[aq]s\\[aq]) != NULL)\n" |
| 1215 |
" seals |= F_SEAL_SHRINK;\n" |
| 1216 |
" if (strchr(seals_arg, \\[aq]w\\[aq]) != NULL)\n" |
| 1217 |
" seals |= F_SEAL_WRITE;\n" |
| 1218 |
" if (strchr(seals_arg, \\[aq]W\\[aq]) != NULL)\n" |
| 1219 |
" seals |= F_SEAL_FUTURE_WRITE;\n" |
| 1220 |
" if (strchr(seals_arg, \\[aq]S\\[aq]) != NULL)\n" |
| 1221 |
" seals |= F_SEAL_SEAL;\n" |
| 1222 |
"\\&\n" |
| 1223 |
" if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n" |
| 1224 |
" err(EXIT_FAILURE, \"fcntl\");\n" |
| 1225 |
" }\n" |
| 1226 |
"\\&\n" |
| 1227 |
" /* Keep running, so that the file created by memfd_create()\n" |
| 1228 |
" continues to exist. */\n" |
| 1229 |
"\\&\n" |
| 1230 |
" pause();\n" |
| 1231 |
"\\&\n" |
| 1232 |
" exit(EXIT_SUCCESS);\n" |
| 1233 |
"}\n" |
| 1234 |
msgstr "" |
| 1235 |
|
| 1236 |
#. type: Plain text |
| 1237 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1238 |
#, no-wrap |
| 1239 |
msgid "" |
| 1240 |
"#define _GNU_SOURCE\n" |
| 1241 |
"#include E<lt>err.hE<gt>\n" |
| 1242 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1243 |
"#include E<lt>stdio.hE<gt>\n" |
| 1244 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1245 |
"\\&\n" |
| 1246 |
"int\n" |
| 1247 |
"main(int argc, char *argv[])\n" |
| 1248 |
"{\n" |
| 1249 |
" int fd;\n" |
| 1250 |
" unsigned int seals;\n" |
| 1251 |
"\\&\n" |
| 1252 |
" if (argc != 2) {\n" |
| 1253 |
" fprintf(stderr, \"%s /proc/PID/fd/FD\\[rs]n\", argv[0]);\n" |
| 1254 |
" exit(EXIT_FAILURE);\n" |
| 1255 |
" }\n" |
| 1256 |
"\\&\n" |
| 1257 |
" fd = open(argv[1], O_RDWR);\n" |
| 1258 |
" if (fd == -1)\n" |
| 1259 |
" err(EXIT_FAILURE, \"open\");\n" |
| 1260 |
"\\&\n" |
| 1261 |
" seals = fcntl(fd, F_GET_SEALS);\n" |
| 1262 |
" if (seals == -1)\n" |
| 1263 |
" err(EXIT_FAILURE, \"fcntl\");\n" |
| 1264 |
"\\&\n" |
| 1265 |
" printf(\"Existing seals:\");\n" |
| 1266 |
" if (seals & F_SEAL_SEAL)\n" |
| 1267 |
" printf(\" SEAL\");\n" |
| 1268 |
" if (seals & F_SEAL_GROW)\n" |
| 1269 |
" printf(\" GROW\");\n" |
| 1270 |
" if (seals & F_SEAL_WRITE)\n" |
| 1271 |
" printf(\" WRITE\");\n" |
| 1272 |
" if (seals & F_SEAL_FUTURE_WRITE)\n" |
| 1273 |
" printf(\" FUTURE_WRITE\");\n" |
| 1274 |
" if (seals & F_SEAL_SHRINK)\n" |
| 1275 |
" printf(\" SHRINK\");\n" |
| 1276 |
" printf(\"\\[rs]n\");\n" |
| 1277 |
"\\&\n" |
| 1278 |
" /* Code to map the file and access the contents of the\n" |
| 1279 |
" resulting mapping omitted. */\n" |
| 1280 |
"\\&\n" |
| 1281 |
" exit(EXIT_SUCCESS);\n" |
| 1282 |
"}\n" |
| 1283 |
msgstr "" |
| 1284 |
|
| 1285 |
#. type: TH |
| 1286 |
#: fedora-44 fedora-rawhide |
| 1287 |
#, no-wrap |
| 1288 |
msgid "2024-11-17" |
| 1289 |
msgstr "17 ноября 2024 г." |
| 1290 |
|
| 1291 |
#. type: TH |
| 1292 |
#: fedora-44 fedora-rawhide |
| 1293 |
#, no-wrap |
| 1294 |
msgid "Linux man-pages 6.13" |
| 1295 |
msgstr "Страницы руководства Linux 6.13" |
| 1296 |
|
| 1297 |
#. type: Plain text |
| 1298 |
#: fedora-44 fedora-rawhide |
| 1299 |
#, no-wrap |
| 1300 |
msgid "" |
| 1301 |
"#define _GNU_SOURCE\n" |
| 1302 |
"#include E<lt>err.hE<gt>\n" |
| 1303 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1304 |
"#include E<lt>stdint.hE<gt>\n" |
| 1305 |
"#include E<lt>stdio.hE<gt>\n" |
| 1306 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1307 |
"#include E<lt>string.hE<gt>\n" |
| 1308 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1309 |
"#include E<lt>sys/types.hE<gt>\n" |
| 1310 |
"#include E<lt>unistd.hE<gt>\n" |
| 1311 |
"\\&\n" |
| 1312 |
"int\n" |
| 1313 |
"main(int argc, char *argv[])\n" |
| 1314 |
"{\n" |
| 1315 |
" int fd;\n" |
| 1316 |
" char *name, *seals_arg;\n" |
| 1317 |
" ssize_t size;\n" |
| 1318 |
" unsigned int seals;\n" |
| 1319 |
"\\&\n" |
| 1320 |
" if (argc E<lt> 3) {\n" |
| 1321 |
" fprintf(stderr, \"%s name size [seals]\\[rs]n\", argv[0]);\n" |
| 1322 |
" fprintf(stderr, \"\\[rs]t\\[aq]seals\\[aq] can contain any of the \"\n" |
| 1323 |
" \"following characters:\\[rs]n\");\n" |
| 1324 |
" fprintf(stderr, \"\\[rs]t\\[rs]tg - F_SEAL_GROW\\[rs]n\");\n" |
| 1325 |
" fprintf(stderr, \"\\[rs]t\\[rs]ts - F_SEAL_SHRINK\\[rs]n\");\n" |
| 1326 |
" fprintf(stderr, \"\\[rs]t\\[rs]tw - F_SEAL_WRITE\\[rs]n\");\n" |
| 1327 |
" fprintf(stderr, \"\\[rs]t\\[rs]tW - F_SEAL_FUTURE_WRITE\\[rs]n\");\n" |
| 1328 |
" fprintf(stderr, \"\\[rs]t\\[rs]tS - F_SEAL_SEAL\\[rs]n\");\n" |
| 1329 |
" exit(EXIT_FAILURE);\n" |
| 1330 |
" }\n" |
| 1331 |
"\\&\n" |
| 1332 |
" name = argv[1];\n" |
| 1333 |
" size = atoi(argv[2]);\n" |
| 1334 |
" seals_arg = argv[3];\n" |
| 1335 |
"\\&\n" |
| 1336 |
" /* Create an anonymous file in tmpfs; allow seals to be\n" |
| 1337 |
" placed on the file. */\n" |
| 1338 |
"\\&\n" |
| 1339 |
" fd = memfd_create(name, MFD_ALLOW_SEALING);\n" |
| 1340 |
" if (fd == -1)\n" |
| 1341 |
" err(EXIT_FAILURE, \"memfd_create\");\n" |
| 1342 |
"\\&\n" |
| 1343 |
" /* Size the file as specified on the command line. */\n" |
| 1344 |
"\\&\n" |
| 1345 |
" if (ftruncate(fd, size) == -1)\n" |
| 1346 |
" err(EXIT_FAILURE, \"truncate\");\n" |
| 1347 |
"\\&\n" |
| 1348 |
" printf(\"PID: %jd; fd: %d; /proc/%jd/fd/%d\\[rs]n\",\n" |
| 1349 |
" (intmax_t) getpid(), fd, (intmax_t) getpid(), fd);\n" |
| 1350 |
"\\&\n" |
| 1351 |
" /* Code to map the file and populate the mapping with data\n" |
| 1352 |
" omitted. */\n" |
| 1353 |
"\\&\n" |
| 1354 |
" /* If a \\[aq]seals\\[aq] command-line argument was supplied, set some\n" |
| 1355 |
" seals on the file. */\n" |
| 1356 |
"\\&\n" |
| 1357 |
" if (seals_arg != NULL) {\n" |
| 1358 |
" seals = 0;\n" |
| 1359 |
"\\&\n" |
| 1360 |
" if (strchr(seals_arg, \\[aq]g\\[aq]) != NULL)\n" |
| 1361 |
" seals |= F_SEAL_GROW;\n" |
| 1362 |
" if (strchr(seals_arg, \\[aq]s\\[aq]) != NULL)\n" |
| 1363 |
" seals |= F_SEAL_SHRINK;\n" |
| 1364 |
" if (strchr(seals_arg, \\[aq]w\\[aq]) != NULL)\n" |
| 1365 |
" seals |= F_SEAL_WRITE;\n" |
| 1366 |
" if (strchr(seals_arg, \\[aq]W\\[aq]) != NULL)\n" |
| 1367 |
" seals |= F_SEAL_FUTURE_WRITE;\n" |
| 1368 |
" if (strchr(seals_arg, \\[aq]S\\[aq]) != NULL)\n" |
| 1369 |
" seals |= F_SEAL_SEAL;\n" |
| 1370 |
"\\&\n" |
| 1371 |
" if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n" |
| 1372 |
" err(EXIT_FAILURE, \"fcntl\");\n" |
| 1373 |
" }\n" |
| 1374 |
"\\&\n" |
| 1375 |
" /* Keep running, so that the file created by memfd_create()\n" |
| 1376 |
" continues to exist. */\n" |
| 1377 |
"\\&\n" |
| 1378 |
" pause();\n" |
| 1379 |
"\\&\n" |
| 1380 |
" exit(EXIT_SUCCESS);\n" |
| 1381 |
"}\n" |
| 1382 |
msgstr "" |
| 1383 |
|
| 1384 |
#. type: TH |
| 1385 |
#: mageia-cauldron |
| 1386 |
#, no-wrap |
| 1387 |
msgid "Linux man-pages 6.17" |
| 1388 |
msgstr "Страницы руководства Linux 6.17" |
| 1389 |
|
| 1390 |
#. type: TH |
| 1391 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 1392 |
#, no-wrap |
| 1393 |
msgid "Linux man-pages (unreleased)" |
| 1394 |
msgstr "Страницы руководства Linux (не выпущены)" |