Debian Codegraph @

po/ru/man3/shm_open.3.po

raw
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 # Alexander Golubev <[email protected]>, 2018.
5 # Azamat Hackimov <[email protected]>, 2011, 2014-2016.
6 # Hotellook, 2014.
7 # Nikita <[email protected]>, 2014.
8 # Spiros Georgaras <[email protected]>, 2016.
9 # Vladislav <[email protected]>, 2015.
10 # Yuri Kozlov <[email protected]>, 2011-2019.
11 # Иван Павлов <[email protected]>, 2017.
12 msgid ""
13 msgstr ""
14 "Project-Id-Version: manpages-l10n\n"
15 "POT-Creation-Date: 2026-06-05 06:43+0200\n"
16 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
17 "Last-Translator: Yuri Kozlov <[email protected]>\n"
18 "Language-Team: Russian <[email protected]>\n"
19 "Language: ru\n"
20 "MIME-Version: 1.0\n"
21 "Content-Type: text/plain; charset=UTF-8\n"
22 "Content-Transfer-Encoding: 8bit\n"
23 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
24 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
25 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
26 "X-Generator: Lokalize 2.0\n"
27
28 #. type: TH
29 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
30 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
31 #, fuzzy, no-wrap
32 #| msgid "I<shm_perm>"
33 msgid "shm_open"
34 msgstr "I<shm_perm>"
35
36 #. type: TH
37 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
38 #: opensuse-tumbleweed
39 #, no-wrap
40 msgid "2026-02-08"
41 msgstr "8 февраля 2026 г."
42
43 #. type: TH
44 #: archlinux debian-unstable
45 #, fuzzy, no-wrap
46 #| msgid "Linux man-pages 6.17"
47 msgid "Linux man-pages 6.18"
48 msgstr "Справочные страницы Linux 6.17"
49
50 #. type: SH
51 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
52 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
53 #, no-wrap
54 msgid "NAME"
55 msgstr "НАИМЕНОВАНИЕ"
56
57 #. type: Plain text
58 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
59 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
60 msgid ""
61 "shm_open, shm_unlink - create/open or unlink POSIX shared memory objects"
62 msgstr ""
63 "shm_open, shm_unlink - создаёт/открывает или удаляет объекты общей памяти "
64 "POSIX"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "БИБЛИОТЕКА"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Real-time library (I<librt>,\\ I<-lrt>)"
77 msgstr "Библиотека реального времени (I<librt>,\\ I<-lrt>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "СИНТАКСИС"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, fuzzy, no-wrap
90 #| msgid ""
91 #| "B<#include E<lt>sys/types.hE<gt>>\n"
92 #| "B<#include E<lt>sys/stat.hE<gt>>\n"
93 #| "B<#include E<lt>unistd.hE<gt>>\n"
94 #| "B<#include E<lt>fcntl.hE<gt> >/* Definition of AT_* constants */\n"
95 msgid ""
96 "B<#include E<lt>sys/mman.hE<gt>>\n"
97 "B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n"
98 "B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>\n"
101 "B<#include E<lt>sys/stat.hE<gt>>\n"
102 "B<#include E<lt>unistd.hE<gt>>\n"
103 "B<#include E<lt>fcntl.hE<gt> >/* константы AT_* */\n"
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 #, fuzzy, no-wrap
109 #| msgid "B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>"
110 msgid ""
111 "B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>\n"
112 "B<int shm_unlink(const char *>I<name>B<);>\n"
113 msgstr "B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>"
114
115 #. type: SH
116 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
117 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
118 #, no-wrap
119 msgid "DESCRIPTION"
120 msgstr "ОПИСАНИЕ"
121
122 #. type: Plain text
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 msgid ""
126 "B<shm_open>() creates and opens a new, or opens an existing, POSIX shared "
127 "memory object. A POSIX shared memory object is in effect a handle which can "
128 "be used by unrelated processes to B<mmap>(2) the same region of shared "
129 "memory. The B<shm_unlink>() function performs the converse operation, "
130 "removing an object previously created by B<shm_open>()."
131 msgstr ""
132 "Функция B<shm_open>() создаёт и открывает новый (или открывает уже "
133 "существующий) объект общей памяти POSIX. Объект общей памяти POSIX — это "
134 "описатель, используемый несвязанными процессами для выполнения B<mmap>(2) "
135 "для одной области общей памяти. Функция B<shm_unlink>() выполняет обратную "
136 "операцию, удаляя объект, созданный ранее с помощью B<shm_open>()."
137
138 #. glibc allows the initial slash to be omitted, and makes
139 #. multiple initial slashes equivalent to a single slash.
140 #. This differs from the implementation of POSIX message queues.
141 #. glibc allows subdirectory components in the name, in which
142 #. case the subdirectory must exist under /dev/shm, and allow the
143 #. required permissions if a user wants to create a shared memory
144 #. object in that subdirectory.
145 #. type: Plain text
146 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
147 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
148 msgid ""
149 "The operation of B<shm_open>() is analogous to that of B<open>(2). I<name> "
150 "specifies the shared memory object to be created or opened. For portable "
151 "use, a shared memory object should be identified by a name of the form I</"
152 "somename>; that is, a null-terminated string of up to B<NAME_MAX> (i.e., "
153 "255) characters consisting of an initial slash, followed by one or more "
154 "characters, none of which are slashes."
155 msgstr ""
156 "Действие B<shm_open>() аналогично B<open>(2). Значением I<name> определяется "
157 "создаваемый или открываемый объект общей памяти. Для использования в "
158 "переносимых программах объект общей памяти должен опознаваться по имени в "
159 "виде I</какое_то_имя>, то есть строкой, оканчивающейся null и длиной до "
160 "I<NAME_MAX> (т.е., 255) символов, состоящей из начальной косой черты и "
161 "одного или более символов (любых, кроме косой черты)."
162
163 #. type: Plain text
164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
166 msgid ""
167 "I<oflag> is a bit mask created by ORing together exactly one of B<O_RDONLY> "
168 "or B<O_RDWR> and any of the other flags listed here:"
169 msgstr ""
170 "Аргумент I<oflag> содержит маску битов, созданную логическим сложением OR "
171 "одного из флагов B<O_RDONLY> или B<O_RWDR> и любых других флагов, "
172 "перечисленных далее:"
173
174 #. type: TP
175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
177 #, no-wrap
178 msgid "B<O_RDONLY>"
179 msgstr "B<O_RDONLY>"
180
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid ""
185 "Open the object for read access. A shared memory object opened in this way "
186 "can be B<mmap>(2)ed only for read (B<PROT_READ>) access."
187 msgstr ""
188 "Открыть объект для чтения. Открытый таким образом объект общей памяти можно "
189 "указывать в B<mmap>(2) только для чтения (B<PROT_READ>)."
190
191 #. type: TP
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 #, no-wrap
195 msgid "B<O_RDWR>"
196 msgstr "B<O_RDWR>"
197
198 #. type: Plain text
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 msgid "Open the object for read-write access."
202 msgstr "Открыть объект для чтения и записи."
203
204 #. type: TP
205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
207 #, no-wrap
208 msgid "B<O_CREAT>"
209 msgstr "B<O_CREAT>"
210
211 #. In truth it is actually the filesystem IDs on Linux, but these
212 #. are nearly always the same as the effective IDs. (MTK, Jul 05)
213 #. type: Plain text
214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
216 msgid ""
217 "Create the shared memory object if it does not exist. The user and group "
218 "ownership of the object are taken from the corresponding effective IDs of "
219 "the calling process, and the object's permission bits are set according to "
220 "the low-order 9 bits of I<mode>, except that those bits set in the process "
221 "file mode creation mask (see B<umask>(2)) are cleared for the new object. "
222 "A set of macro constants which can be used to define I<mode> is listed in "
223 "B<open>(2). (Symbolic definitions of these constants can be obtained by "
224 "including I<E<lt>sys/stat.hE<gt>>.)"
225 msgstr ""
226 "Создать объект общей памяти, если он не существует. Владелец и группа "
227 "объекта устанавливаются из соответствующих эффективных ID вызвавшего "
228 "процесса, а биты прав на объект устанавливаются в соответствии с младшими 9 "
229 "битами I<mode>, за исключением того, что биты, установленные маске режима "
230 "создания файла (см. B<umask>(2)), очищаются у новых объектов. Набор макросов-"
231 "констант, используемых для определения I<mode>, описан в B<open>(2). "
232 "Символические определения этих констант можно получить включением I<E<lt>sys/"
233 "stat.hE<gt>>."
234
235 #. type: Plain text
236 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
237 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
238 #, fuzzy
239 #| msgid ""
240 #| "A new shared memory object initially has zero length\\(emthe size of the "
241 #| "object can be set using B<ftruncate>(2). The newly allocated bytes of a "
242 #| "shared memory object are automatically initialized to 0."
243 msgid ""
244 "A new shared memory object initially has zero length\\[em]the size of the "
245 "object can be set using B<ftruncate>(2). The newly allocated bytes of a "
246 "shared memory object are automatically initialized to 0."
247 msgstr ""
248 "Новый объект общей памяти изначально имеет нулевую длину; размер объекта "
249 "можно установить, используя B<ftruncate>(2). Новые выделенные байты объекта "
250 "общей памяти автоматически заполняются 0."
251
252 #. type: TP
253 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
254 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
255 #, no-wrap
256 msgid "B<O_EXCL>"
257 msgstr "B<O_EXCL>"
258
259 #. type: Plain text
260 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
261 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
262 msgid ""
263 "If B<O_CREAT> was also specified, and a shared memory object with the given "
264 "I<name> already exists, return an error. The check for the existence of the "
265 "object, and its creation if it does not exist, are performed atomically."
266 msgstr ""
267 "Если также был указан B<O_CREAT> и объект общей памяти с заданным I<name> "
268 "уже существует, то возвращается ошибка. Проверка существования объекта и его "
269 "создание, если он не существует, выполняется атомарно."
270
271 #. type: TP
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, no-wrap
275 msgid "B<O_TRUNC>"
276 msgstr "B<O_TRUNC>"
277
278 #. type: Plain text
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 msgid "If the shared memory object already exists, truncate it to zero bytes."
282 msgstr "Если объект общей памяти уже существует, то обрезать его до 0 байтов."
283
284 #. type: Plain text
285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
287 msgid ""
288 "Definitions of these flag values can be obtained by including "
289 "I<E<lt>fcntl.hE<gt>>."
290 msgstr ""
291 "Определения значений этих флагов можно получить включением "
292 "I<E<lt>fcntl.hE<gt>>."
293
294 #. type: Plain text
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 msgid ""
298 "On successful completion B<shm_open>() returns a new file descriptor "
299 "referring to the shared memory object. This file descriptor is guaranteed "
300 "to be the lowest-numbered file descriptor not previously opened within the "
301 "process. The B<FD_CLOEXEC> flag (see B<fcntl>(2)) is set for the file "
302 "descriptor."
303 msgstr ""
304 "При успешном выполнении B<shm_open>() возвращает новый файловый дескриптор, "
305 "ссылающийся на объект общей памяти. Этот файловый дескриптор гарантированно "
306 "будет дескриптором файла с самым маленьким номером среди ещё не открытых "
307 "процессом. У дескриптора файла устанавливается флаг B<FD_CLOEXEC> (см. "
308 "B<fcntl>(2))."
309
310 #. type: Plain text
311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
313 msgid ""
314 "The file descriptor is normally used in subsequent calls to B<ftruncate>(2) "
315 "(for a newly created object) and B<mmap>(2). After a call to B<mmap>(2) "
316 "the file descriptor may be closed without affecting the memory mapping."
317 msgstr ""
318 "Дескриптор файла обычно используется в последующих вызовах B<ftruncate>(2) "
319 "(для новых объектов) и B<mmap>(2). После вызова B<mmap>(2) дескриптор файла "
320 "может быть закрыт без влияния на отображение памяти."
321
322 #. type: Plain text
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 #, fuzzy
326 #| msgid ""
327 #| "The operation of B<shm_unlink>() is analogous to B<unlink>(2): it "
328 #| "removes a shared memory object name, and, once all processes have "
329 #| "unmapped the object, de-allocates and destroys the contents of the "
330 #| "associated memory region. After a successful B<shm_unlink>(), attempts "
331 #| "to B<shm_open>() an object with the same I<name> fail (unless B<O_CREAT> "
332 #| "was specified, in which case a new, distinct object is created)."
333 msgid ""
334 "The operation of B<shm_unlink>() is analogous to B<unlink>(2): it removes a "
335 "shared memory object name, and, once all processes have unmapped the object, "
336 "deallocates and destroys the contents of the associated memory region. "
337 "After a successful B<shm_unlink>(), attempts to B<shm_open>() an object "
338 "with the same I<name> fail (unless B<O_CREAT> was specified, in which case a "
339 "new, distinct object is created)."
340 msgstr ""
341 "Действие B<shm_unlink>() аналогично B<unlink>(2): оно удаляет имя объекта "
342 "общей памяти и, как только все процессы завершили работу с объектом и "
343 "отменили его отображение, очищает пространство и уничтожает связанную с ним "
344 "область памяти. После успешного выполнения B<shm_unlink>() попытка выполнить "
345 "B<shm_open>() для объекта с тем же именем I<name> завершается ошибкой (если "
346 "не был указан B<O_CREAT>, в этом случае создаётся новый, уже другой объект)."
347
348 #. type: SH
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 #, no-wrap
352 msgid "RETURN VALUE"
353 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
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 #, fuzzy
359 #| msgid ""
360 #| "On success, B<shm_open>() returns a nonnegative file descriptor. On "
361 #| "failure, B<shm_open>() returns -1. B<shm_unlink>() returns 0 on "
362 #| "success, or -1 on error."
363 msgid ""
364 "On success, B<shm_open>() returns a file descriptor (a nonnegative "
365 "integer). On success, B<shm_unlink>() returns 0. On failure, both "
366 "functions return -1 and set I<errno> to indicate the error."
367 msgstr ""
368 "При успешном выполнении B<shm_open>() возвращает неотрицательный дескриптор "
369 "файла. При ошибках B<shm_open>() возвращает -1. При успешном выполнении "
370 "B<shm_unlink>() возвращает 0 и -1 при ошибке."
371
372 #. type: SH
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 #, no-wrap
376 msgid "ERRORS"
377 msgstr "ОШИБКИ"
378
379 #. type: TP
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 #, no-wrap
383 msgid "B<EACCES>"
384 msgstr "B<EACCES>"
385
386 #. type: Plain text
387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
389 msgid "Permission to B<shm_unlink>() the shared memory object was denied."
390 msgstr "Отказ в доступе для B<shm_unlink>() для объекта общей памяти."
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 "Permission was denied to B<shm_open>() I<name> in the specified I<mode>, or "
397 "B<O_TRUNC> was specified and the caller does not have write permission on "
398 "the object."
399 msgstr ""
400 "Отказ в доступе для B<shm_open>() с заданным I<name> и режимом I<mode>, или "
401 "был указан B<O_TRUNC>, а вызывающий не имеет прав на запись для объекта."
402
403 #. type: TP
404 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
405 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
406 #, no-wrap
407 msgid "B<EEXIST>"
408 msgstr "B<EEXIST>"
409
410 #. type: Plain text
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 msgid ""
414 "Both B<O_CREAT> and B<O_EXCL> were specified to B<shm_open>() and the "
415 "shared memory object specified by I<name> already exists."
416 msgstr ""
417 "В B<shm_open>() указаны B<O_CREAT> и B<O_EXCL>, но объект общей памяти "
418 "I<name> уже существует."
419
420 #. type: TP
421 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
422 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
423 #, no-wrap
424 msgid "B<EINVAL>"
425 msgstr "B<EINVAL>"
426
427 #. type: Plain text
428 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
429 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
430 msgid "The I<name> argument to B<shm_open>() was invalid."
431 msgstr "Аргумент I<name> для B<shm_open>() некорректен."
432
433 #. type: TP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "B<EMFILE>"
438 msgstr "B<EMFILE>"
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid ""
444 "The per-process limit on the number of open file descriptors has been "
445 "reached."
446 msgstr ""
447 "Было достигнуто ограничение по количеству открытых файловых дескрипторов на "
448 "процесс."
449
450 #. type: TP
451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
453 #, no-wrap
454 msgid "B<ENAMETOOLONG>"
455 msgstr "B<ENAMETOOLONG>"
456
457 #. type: Plain text
458 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
459 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
460 msgid "The length of I<name> exceeds B<PATH_MAX>."
461 msgstr "Длина I<name> превышает B<PATH_MAX>."
462
463 #. type: TP
464 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
465 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
466 #, no-wrap
467 msgid "B<ENFILE>"
468 msgstr "B<ENFILE>"
469
470 #. type: Plain text
471 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
472 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
473 msgid ""
474 "The system-wide limit on the total number of open files has been reached."
475 msgstr "Достигнуто максимальное количество открытых файлов в системе."
476
477 #. type: TP
478 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
479 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
480 #, no-wrap
481 msgid "B<ENOENT>"
482 msgstr "B<ENOENT>"
483
484 #. type: Plain text
485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
487 msgid ""
488 "An attempt was made to B<shm_open>() a I<name> that did not exist, and "
489 "B<O_CREAT> was not specified."
490 msgstr ""
491 "Была сделана попытка выполнить B<shm_open>() для несуществующего I<name> и "
492 "при этом не был указан B<O_CREAT>."
493
494 #. type: Plain text
495 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
496 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
497 msgid ""
498 "An attempt was to made to B<shm_unlink>() a I<name> that does not exist."
499 msgstr ""
500 "Была сделана попытка выполнить B<shm_unlink>() для несуществующего I<name>."
501
502 #. type: SH
503 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
504 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
505 #, no-wrap
506 msgid "ATTRIBUTES"
507 msgstr "АТРИБУТЫ"
508
509 #. type: Plain text
510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
512 msgid ""
513 "For an explanation of the terms used in this section, see B<attributes>(7)."
514 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
515
516 #. type: tbl table
517 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
518 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
519 #, no-wrap
520 msgid "Interface"
521 msgstr "Интерфейс"
522
523 #. type: tbl table
524 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
525 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
526 #, no-wrap
527 msgid "Attribute"
528 msgstr "Атрибут"
529
530 #. type: tbl table
531 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
532 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
533 #, no-wrap
534 msgid "Value"
535 msgstr "Значение"
536
537 #. type: tbl table
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 #, no-wrap
541 msgid ".na\n"
542 msgstr ".na\n"
543
544 #. type: tbl table
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 #, no-wrap
548 msgid ".nh\n"
549 msgstr ".nh\n"
550
551 #. type: tbl table
552 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
553 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
554 #, no-wrap
555 msgid ""
556 "B<shm_open>(),\n"
557 "B<shm_unlink>()"
558 msgstr ""
559 "B<shm_open>(),\n"
560 "B<shm_unlink>()"
561
562 #. type: tbl table
563 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
564 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
565 #, no-wrap
566 msgid "Thread safety"
567 msgstr "Безвредность в нитях"
568
569 #. type: tbl table
570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
571 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
572 #, no-wrap
573 msgid "MT-Safe locale"
574 msgstr "MT-Safe locale"
575
576 #. type: SH
577 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
578 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
579 #, no-wrap
580 msgid "VERSIONS"
581 msgstr "ВЕРСИИ"
582
583 #. type: Plain text
584 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
585 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
586 #, fuzzy
587 #| msgid ""
588 #| "POSIX leaves the behavior of the combination of B<O_RDONLY> and "
589 #| "B<O_TRUNC> unspecified. On Linux, this will successfully truncate an "
590 #| "existing shared memory object\\(emthis may not be so on other UNIX "
591 #| "systems."
592 msgid ""
593 "POSIX leaves the behavior of the combination of B<O_RDONLY> and B<O_TRUNC> "
594 "unspecified. On Linux, this will successfully truncate an existing shared "
595 "memory object\\[em]this may not be so on other UNIX systems."
596 msgstr ""
597 "POSIX оставляет неопределённым поведение при комбинации B<O_RDONLY> и "
598 "B<O_TRUNC>. В Linux это приводит к успешному обрезанию существующего объекта "
599 "общей памяти, но в других системах UNIX может быть по-другому."
600
601 #. type: Plain text
602 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
603 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
604 msgid ""
605 "The POSIX shared memory object implementation on Linux makes use of a "
606 "dedicated B<tmpfs>(5) filesystem that is normally mounted under I</dev/shm>."
607 msgstr ""
608 "Реализация объектов общей памяти POSIX в Linux использует выделенную "
609 "файловую систему B<tmpfs>(5), которая обычно монтируется в I</dev/shm>."
610
611 #. type: SH
612 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
613 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
614 #, no-wrap
615 msgid "STANDARDS"
616 msgstr "СТАНДАРТЫ"
617
618 #. type: Plain text
619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
621 msgid "POSIX.1-2008."
622 msgstr "POSIX.1-2008."
623
624 #. type: SH
625 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
626 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
627 #, no-wrap
628 msgid "HISTORY"
629 msgstr "ИСТОРИЯ"
630
631 #. type: Plain text
632 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
633 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
634 msgid "glibc 2.2. POSIX.1-2001."
635 msgstr "glibc 2.2. POSIX.1-2001."
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 ""
641 "POSIX.1-2001 says that the group ownership of a newly created shared memory "
642 "object is set to either the calling process's effective group ID or \"a "
643 "system default group ID\". POSIX.1-2008 says that the group ownership may "
644 "be set to either the calling process's effective group ID or, if the object "
645 "is visible in the filesystem, the group ID of the parent directory."
646 msgstr ""
647 "В POSIX.1-2001 сказано, что группа-владелец нового объекта общей памяти "
648 "устанавливается или в эффективный ID группы вызвавшего процесса, или «ID "
649 "системной группы по умолчанию». В POSIX.1-2008 сказано, что группа-владелец "
650 "может быть установлена или в эффективный ID группы вызвавшего процесса или, "
651 "если объект видим в файловой системе, ID группы родительского каталога."
652
653 #. type: SH
654 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
655 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
656 #, no-wrap
657 msgid "EXAMPLES"
658 msgstr "ПРИМЕРЫ"
659
660 #. type: Plain text
661 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
662 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
663 msgid ""
664 "The programs below employ POSIX shared memory and POSIX unnamed semaphores "
665 "to exchange a piece of data. The \"bounce\" program (which must be run "
666 "first) raises the case of a string that is placed into the shared memory by "
667 "the \"send\" program. Once the data has been modified, the \"send\" program "
668 "then prints the contents of the modified shared memory. An example "
669 "execution of the two programs is the following:"
670 msgstr ""
671
672 #. type: Plain text
673 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
674 #: opensuse-tumbleweed
675 #, no-wrap
676 msgid ""
677 "$B< ./pshm_ucase_bounce /myshm &>\n"
678 "[1] 270171\n"
679 "$B< ./pshm_ucase_send /myshm hello>;\n"
680 "HELLO\n"
681 msgstr ""
682
683 #. type: Plain text
684 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
685 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
686 msgid "Further detail about these programs is provided below."
687 msgstr ""
688
689 #. type: SS
690 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
691 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
692 #, fuzzy, no-wrap
693 #| msgid "Program source"
694 msgid "Program source: pshm_ucase.h"
695 msgstr "Исходный код программы"
696
697 #. type: Plain text
698 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
699 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
700 msgid ""
701 "The following header file is included by both programs below. Its primary "
702 "purpose is to define a structure that will be imposed on the memory object "
703 "that is shared between the two programs."
704 msgstr ""
705
706 #. type: Plain text
707 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
708 #: opensuse-tumbleweed
709 #, no-wrap
710 msgid ""
711 "#ifndef PSHM_UCASE_H\n"
712 "#define PSHM_UCASE_H\n"
713 "\\&\n"
714 "#include E<lt>err.hE<gt>\n"
715 "#include E<lt>semaphore.hE<gt>\n"
716 "#include E<lt>stddef.hE<gt>\n"
717 "#include E<lt>stdio.hE<gt>\n"
718 "#include E<lt>stdlib.hE<gt>\n"
719 "\\&\n"
720 "#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n"
721 "\\&\n"
722 "/* Define a structure that will be imposed on the shared\n"
723 " memory object */\n"
724 "\\&\n"
725 "struct shmbuf {\n"
726 " sem_t sem1; /* POSIX unnamed semaphore */\n"
727 " sem_t sem2; /* POSIX unnamed semaphore */\n"
728 " size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n"
729 " char buf[BUF_SIZE]; /* Data being transferred */\n"
730 "};\n"
731 "\\&\n"
732 "#endif // include guard\n"
733 msgstr ""
734
735 #. type: SS
736 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
737 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
738 #, no-wrap
739 msgid "Program source: pshm_ucase_bounce.c"
740 msgstr ""
741
742 #. type: Plain text
743 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
744 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
745 msgid ""
746 "The \"bounce\" program creates a new shared memory object with the name "
747 "given in its command-line argument and sizes the object to match the size of "
748 "the I<shmbuf> structure defined in the header file. It then maps the object "
749 "into the process's address space, and initializes two POSIX semaphores "
750 "inside the object to 0."
751 msgstr ""
752
753 #. type: Plain text
754 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
755 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
756 msgid ""
757 "After the \"send\" program has posted the first of the semaphores, the "
758 "\"bounce\" program upper cases the data that has been placed in the memory "
759 "by the \"send\" program and then posts the second semaphore to tell the "
760 "\"send\" program that it may now access the shared memory."
761 msgstr ""
762
763 #. type: Plain text
764 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
765 #: opensuse-tumbleweed
766 #, no-wrap
767 msgid ""
768 "/* pshm_ucase_bounce.c\n"
769 "\\&\n"
770 " Licensed under GNU General Public License v2 or later.\n"
771 "*/\n"
772 "#include E<lt>ctype.hE<gt>\n"
773 "#include E<lt>fcntl.hE<gt>\n"
774 "#include E<lt>stdio.hE<gt>\n"
775 "#include E<lt>stdlib.hE<gt>\n"
776 "#include E<lt>sys/mman.hE<gt>\n"
777 "#include E<lt>unistd.hE<gt>\n"
778 "\\&\n"
779 "#include \"pshm_ucase.h\"\n"
780 "\\&\n"
781 "int\n"
782 "main(int argc, char *argv[])\n"
783 "{\n"
784 " int fd;\n"
785 " char *shmpath;\n"
786 " struct shmbuf *shmp;\n"
787 "\\&\n"
788 " if (argc != 2) {\n"
789 " fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n"
790 " exit(EXIT_FAILURE);\n"
791 " }\n"
792 "\\&\n"
793 " shmpath = argv[1];\n"
794 "\\&\n"
795 " /* Create shared memory object and set its size to the size\n"
796 " of our structure. */\n"
797 "\\&\n"
798 " fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n"
799 " if (fd == -1)\n"
800 " err(EXIT_FAILURE, \"shm_open\");\n"
801 "\\&\n"
802 " if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n"
803 " err(EXIT_FAILURE, \"ftruncate\");\n"
804 "\\&\n"
805 " /* Map the object into the caller\\[aq]s address space. */\n"
806 "\\&\n"
807 " shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n"
808 " MAP_SHARED, fd, 0);\n"
809 " if (shmp == MAP_FAILED)\n"
810 " err(EXIT_FAILURE, \"mmap\");\n"
811 "\\&\n"
812 " /* Initialize semaphores as process-shared, with value 0. */\n"
813 "\\&\n"
814 " if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n"
815 " err(EXIT_FAILURE, \"sem_init-sem1\");\n"
816 " if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n"
817 " err(EXIT_FAILURE, \"sem_init-sem2\");\n"
818 "\\&\n"
819 " /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n"
820 " shared memory. */\n"
821 "\\&\n"
822 " if (sem_wait(&shmp-E<gt>sem1) == -1)\n"
823 " err(EXIT_FAILURE, \"sem_wait\");\n"
824 "\\&\n"
825 " /* Convert data in shared memory into upper case. */\n"
826 "\\&\n"
827 " for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n"
828 " shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n"
829 "\\&\n"
830 " /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n"
831 " access the modified data in shared memory. */\n"
832 "\\&\n"
833 " if (sem_post(&shmp-E<gt>sem2) == -1)\n"
834 " err(EXIT_FAILURE, \"sem_post\");\n"
835 "\\&\n"
836 " /* Unlink the shared memory object. Even if the peer process\n"
837 " is still using the object, this is okay. The object will\n"
838 " be removed only after all open references are closed. */\n"
839 "\\&\n"
840 " shm_unlink(shmpath);\n"
841 "\\&\n"
842 " exit(EXIT_SUCCESS);\n"
843 "}\n"
844 msgstr ""
845
846 #. type: SS
847 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
848 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
849 #, no-wrap
850 msgid "Program source: pshm_ucase_send.c"
851 msgstr ""
852
853 #. type: Plain text
854 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
855 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
856 msgid ""
857 "The \"send\" program takes two command-line arguments: the pathname of a "
858 "shared memory object previously created by the \"bounce\" program and a "
859 "string that is to be copied into that object."
860 msgstr ""
861
862 #. type: Plain text
863 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
864 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
865 msgid ""
866 "The program opens the shared memory object and maps the object into its "
867 "address space. It then copies the data specified in its second argument "
868 "into the shared memory, and posts the first semaphore, which tells the "
869 "\"bounce\" program that it can now access that data. After the \"bounce\" "
870 "program posts the second semaphore, the \"send\" program prints the contents "
871 "of the shared memory on standard output."
872 msgstr ""
873
874 #. type: Plain text
875 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
876 #: opensuse-tumbleweed
877 #, no-wrap
878 msgid ""
879 "/* pshm_ucase_send.c\n"
880 "\\&\n"
881 " Licensed under GNU General Public License v2 or later.\n"
882 "*/\n"
883 "#include E<lt>fcntl.hE<gt>\n"
884 "#include E<lt>stddef.hE<gt>\n"
885 "#include E<lt>stdio.hE<gt>\n"
886 "#include E<lt>stdlib.hE<gt>\n"
887 "#include E<lt>string.hE<gt>\n"
888 "#include E<lt>sys/mman.hE<gt>\n"
889 "#include E<lt>unistd.hE<gt>\n"
890 "\\&\n"
891 "#include \"pshm_ucase.h\"\n"
892 "\\&\n"
893 "int\n"
894 "main(int argc, char *argv[])\n"
895 "{\n"
896 " int fd;\n"
897 " char *shmpath, *string;\n"
898 " size_t len;\n"
899 " struct shmbuf *shmp;\n"
900 "\\&\n"
901 " if (argc != 3) {\n"
902 " fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n"
903 " exit(EXIT_FAILURE);\n"
904 " }\n"
905 "\\&\n"
906 " shmpath = argv[1];\n"
907 " string = argv[2];\n"
908 " len = strlen(string);\n"
909 "\\&\n"
910 " if (len E<gt> BUF_SIZE) {\n"
911 " fprintf(stderr, \"String is too long\\[rs]n\");\n"
912 " exit(EXIT_FAILURE);\n"
913 " }\n"
914 "\\&\n"
915 " /* Open the existing shared memory object and map it\n"
916 " into the caller\\[aq]s address space. */\n"
917 "\\&\n"
918 " fd = shm_open(shmpath, O_RDWR, 0);\n"
919 " if (fd == -1)\n"
920 " err(EXIT_FAILURE, \"shm_open\");\n"
921 "\\&\n"
922 " shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n"
923 " MAP_SHARED, fd, 0);\n"
924 " if (shmp == MAP_FAILED)\n"
925 " err(EXIT_FAILURE, \"mmap\");\n"
926 "\\&\n"
927 " /* Copy data into the shared memory object. */\n"
928 "\\&\n"
929 " shmp-E<gt>cnt = len;\n"
930 " memcpy(&shmp-E<gt>buf, string, len);\n"
931 "\\&\n"
932 " /* Tell peer that it can now access shared memory. */\n"
933 "\\&\n"
934 " if (sem_post(&shmp-E<gt>sem1) == -1)\n"
935 " err(EXIT_FAILURE, \"sem_post\");\n"
936 "\\&\n"
937 " /* Wait until peer says that it has finished accessing\n"
938 " the shared memory. */\n"
939 "\\&\n"
940 " if (sem_wait(&shmp-E<gt>sem2) == -1)\n"
941 " err(EXIT_FAILURE, \"sem_wait\");\n"
942 "\\&\n"
943 " /* Write modified data in shared memory to standard output. */\n"
944 "\\&\n"
945 " if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n"
946 " err(EXIT_FAILURE, \"write\");\n"
947 " if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n"
948 " err(EXIT_FAILURE, \"write\");\n"
949 "\\&\n"
950 " exit(EXIT_SUCCESS);\n"
951 "}\n"
952 msgstr ""
953
954 #. type: SH
955 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
956 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
957 #, no-wrap
958 msgid "SEE ALSO"
959 msgstr "СМОТРИТЕ ТАКЖЕ"
960
961 #. type: Plain text
962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
964 msgid ""
965 "B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), "
966 "B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), "
967 "B<shm_overview>(7)"
968 msgstr ""
969 "B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), "
970 "B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), "
971 "B<shm_overview>(7)"
972
973 #. type: TH
974 #: debian-trixie
975 #, no-wrap
976 msgid "2024-06-15"
977 msgstr "15 июня 2024 г."
978
979 #. type: TH
980 #: debian-trixie
981 #, no-wrap
982 msgid "Linux man-pages 6.9.1"
983 msgstr "Страницы руководства Linux 6.9.1"
984
985 #. type: Plain text
986 #: debian-trixie
987 msgid "Real-time library (I<librt>, I<-lrt>)"
988 msgstr "Библиотека реального времени (I<librt>, I<-lrt>)"
989
990 #. type: Plain text
991 #: debian-trixie fedora-44 fedora-rawhide
992 #, no-wrap
993 msgid ""
994 "$ B<./pshm_ucase_bounce /myshm &>\n"
995 "[1] 270171\n"
996 "$ B<./pshm_ucase_send /myshm hello>\n"
997 "HELLO\n"
998 msgstr ""
999
1000 #. type: Plain text
1001 #: debian-trixie fedora-44 fedora-rawhide
1002 #, no-wrap
1003 msgid ""
1004 "#ifndef PSHM_UCASE_H\n"
1005 "#define PSHM_UCASE_H\n"
1006 "\\&\n"
1007 "#include E<lt>semaphore.hE<gt>\n"
1008 "#include E<lt>stddef.hE<gt>\n"
1009 "#include E<lt>stdio.hE<gt>\n"
1010 "#include E<lt>stdlib.hE<gt>\n"
1011 "\\&\n"
1012 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1013 " } while (0)\n"
1014 "\\&\n"
1015 "#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n"
1016 "\\&\n"
1017 "/* Define a structure that will be imposed on the shared\n"
1018 " memory object */\n"
1019 "\\&\n"
1020 "struct shmbuf {\n"
1021 " sem_t sem1; /* POSIX unnamed semaphore */\n"
1022 " sem_t sem2; /* POSIX unnamed semaphore */\n"
1023 " size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n"
1024 " char buf[BUF_SIZE]; /* Data being transferred */\n"
1025 "};\n"
1026 "\\&\n"
1027 "#endif // include guard\n"
1028 msgstr ""
1029
1030 #. type: Plain text
1031 #: debian-trixie fedora-44 fedora-rawhide
1032 #, no-wrap
1033 msgid ""
1034 "/* pshm_ucase_bounce.c\n"
1035 "\\&\n"
1036 " Licensed under GNU General Public License v2 or later.\n"
1037 "*/\n"
1038 "#include E<lt>ctype.hE<gt>\n"
1039 "#include E<lt>fcntl.hE<gt>\n"
1040 "#include E<lt>stdio.hE<gt>\n"
1041 "#include E<lt>stdlib.hE<gt>\n"
1042 "#include E<lt>sys/mman.hE<gt>\n"
1043 "#include E<lt>unistd.hE<gt>\n"
1044 "\\&\n"
1045 "#include \"pshm_ucase.h\"\n"
1046 "\\&\n"
1047 "int\n"
1048 "main(int argc, char *argv[])\n"
1049 "{\n"
1050 " int fd;\n"
1051 " char *shmpath;\n"
1052 " struct shmbuf *shmp;\n"
1053 "\\&\n"
1054 " if (argc != 2) {\n"
1055 " fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n"
1056 " exit(EXIT_FAILURE);\n"
1057 " }\n"
1058 "\\&\n"
1059 " shmpath = argv[1];\n"
1060 "\\&\n"
1061 " /* Create shared memory object and set its size to the size\n"
1062 " of our structure. */\n"
1063 "\\&\n"
1064 " fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n"
1065 " if (fd == -1)\n"
1066 " errExit(\"shm_open\");\n"
1067 "\\&\n"
1068 " if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n"
1069 " errExit(\"ftruncate\");\n"
1070 "\\&\n"
1071 " /* Map the object into the caller\\[aq]s address space. */\n"
1072 "\\&\n"
1073 " shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n"
1074 " MAP_SHARED, fd, 0);\n"
1075 " if (shmp == MAP_FAILED)\n"
1076 " errExit(\"mmap\");\n"
1077 "\\&\n"
1078 " /* Initialize semaphores as process-shared, with value 0. */\n"
1079 "\\&\n"
1080 " if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n"
1081 " errExit(\"sem_init-sem1\");\n"
1082 " if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n"
1083 " errExit(\"sem_init-sem2\");\n"
1084 "\\&\n"
1085 " /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n"
1086 " shared memory. */\n"
1087 "\\&\n"
1088 " if (sem_wait(&shmp-E<gt>sem1) == -1)\n"
1089 " errExit(\"sem_wait\");\n"
1090 "\\&\n"
1091 " /* Convert data in shared memory into upper case. */\n"
1092 "\\&\n"
1093 " for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n"
1094 " shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n"
1095 "\\&\n"
1096 " /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n"
1097 " access the modified data in shared memory. */\n"
1098 "\\&\n"
1099 " if (sem_post(&shmp-E<gt>sem2) == -1)\n"
1100 " errExit(\"sem_post\");\n"
1101 "\\&\n"
1102 " /* Unlink the shared memory object. Even if the peer process\n"
1103 " is still using the object, this is okay. The object will\n"
1104 " be removed only after all open references are closed. */\n"
1105 "\\&\n"
1106 " shm_unlink(shmpath);\n"
1107 "\\&\n"
1108 " exit(EXIT_SUCCESS);\n"
1109 "}\n"
1110 msgstr ""
1111
1112 #. type: Plain text
1113 #: debian-trixie
1114 #, no-wrap
1115 msgid ""
1116 "/* pshm_ucase_send.c\n"
1117 "\\&\n"
1118 " Licensed under GNU General Public License v2 or later.\n"
1119 "*/\n"
1120 "#include E<lt>fcntl.hE<gt>\n"
1121 "#include E<lt>stddef.hE<gt>\n"
1122 "#include E<lt>stdio.hE<gt>\n"
1123 "#include E<lt>stdlib.hE<gt>\n"
1124 "#include E<lt>string.hE<gt>\n"
1125 "#include E<lt>sys/mman.hE<gt>\n"
1126 "#include E<lt>unistd.hE<gt>\n"
1127 "\\&\n"
1128 "#include \"pshm_ucase.h\"\n"
1129 "\\&\n"
1130 "int\n"
1131 "main(int argc, char *argv[])\n"
1132 "{\n"
1133 " int fd;\n"
1134 " char *shmpath, *string;\n"
1135 " size_t len;\n"
1136 " struct shmbuf *shmp;\n"
1137 "\\&\n"
1138 " if (argc != 3) {\n"
1139 " fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n"
1140 " exit(EXIT_FAILURE);\n"
1141 " }\n"
1142 "\\&\n"
1143 " shmpath = argv[1];\n"
1144 " string = argv[2];\n"
1145 " len = strlen(string);\n"
1146 "\\&\n"
1147 " if (len E<gt> BUF_SIZE) {\n"
1148 " fprintf(stderr, \"String is too long\\[rs]n\");\n"
1149 " exit(EXIT_FAILURE);\n"
1150 " }\n"
1151 "\\&\n"
1152 " /* Open the existing shared memory object and map it\n"
1153 " into the caller\\[aq]s address space. */\n"
1154 "\\&\n"
1155 " fd = shm_open(shmpath, O_RDWR, 0);\n"
1156 " if (fd == -1)\n"
1157 " errExit(\"shm_open\");\n"
1158 "\\&\n"
1159 " shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n"
1160 " MAP_SHARED, fd, 0);\n"
1161 " if (shmp == MAP_FAILED)\n"
1162 " errExit(\"mmap\");\n"
1163 "\\&\n"
1164 " /* Copy data into the shared memory object. */\n"
1165 "\\&\n"
1166 " shmp-E<gt>cnt = len;\n"
1167 " memcpy(&shmp-E<gt>buf, string, len);\n"
1168 "\\&\n"
1169 " /* Tell peer that it can now access shared memory. */\n"
1170 "\\&\n"
1171 " if (sem_post(&shmp-E<gt>sem1) == -1)\n"
1172 " errExit(\"sem_post\");\n"
1173 "\\&\n"
1174 " /* Wait until peer says that it has finished accessing\n"
1175 " the shared memory. */\n"
1176 "\\&\n"
1177 " if (sem_wait(&shmp-E<gt>sem2) == -1)\n"
1178 " errExit(\"sem_wait\");\n"
1179 "\\&\n"
1180 " /* Write modified data in shared memory to standard output. */\n"
1181 "\\&\n"
1182 " write(STDOUT_FILENO, &shmp-E<gt>buf, len);\n"
1183 " write(STDOUT_FILENO, \"\\[rs]n\", 1);\n"
1184 "\\&\n"
1185 " exit(EXIT_SUCCESS);\n"
1186 "}\n"
1187 msgstr ""
1188
1189 #. type: TH
1190 #: fedora-44 fedora-rawhide
1191 #, no-wrap
1192 msgid "2024-07-23"
1193 msgstr "23 июля 2024 г."
1194
1195 #. type: TH
1196 #: fedora-44 fedora-rawhide
1197 #, no-wrap
1198 msgid "Linux man-pages 6.13"
1199 msgstr "Страницы руководства Linux 6.13"
1200
1201 #. type: Plain text
1202 #: fedora-44 fedora-rawhide
1203 #, no-wrap
1204 msgid ""
1205 "/* pshm_ucase_send.c\n"
1206 "\\&\n"
1207 " Licensed under GNU General Public License v2 or later.\n"
1208 "*/\n"
1209 "#include E<lt>fcntl.hE<gt>\n"
1210 "#include E<lt>stddef.hE<gt>\n"
1211 "#include E<lt>stdio.hE<gt>\n"
1212 "#include E<lt>stdlib.hE<gt>\n"
1213 "#include E<lt>string.hE<gt>\n"
1214 "#include E<lt>sys/mman.hE<gt>\n"
1215 "#include E<lt>unistd.hE<gt>\n"
1216 "\\&\n"
1217 "#include \"pshm_ucase.h\"\n"
1218 "\\&\n"
1219 "int\n"
1220 "main(int argc, char *argv[])\n"
1221 "{\n"
1222 " int fd;\n"
1223 " char *shmpath, *string;\n"
1224 " size_t len;\n"
1225 " struct shmbuf *shmp;\n"
1226 "\\&\n"
1227 " if (argc != 3) {\n"
1228 " fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n"
1229 " exit(EXIT_FAILURE);\n"
1230 " }\n"
1231 "\\&\n"
1232 " shmpath = argv[1];\n"
1233 " string = argv[2];\n"
1234 " len = strlen(string);\n"
1235 "\\&\n"
1236 " if (len E<gt> BUF_SIZE) {\n"
1237 " fprintf(stderr, \"String is too long\\[rs]n\");\n"
1238 " exit(EXIT_FAILURE);\n"
1239 " }\n"
1240 "\\&\n"
1241 " /* Open the existing shared memory object and map it\n"
1242 " into the caller\\[aq]s address space. */\n"
1243 "\\&\n"
1244 " fd = shm_open(shmpath, O_RDWR, 0);\n"
1245 " if (fd == -1)\n"
1246 " errExit(\"shm_open\");\n"
1247 "\\&\n"
1248 " shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n"
1249 " MAP_SHARED, fd, 0);\n"
1250 " if (shmp == MAP_FAILED)\n"
1251 " errExit(\"mmap\");\n"
1252 "\\&\n"
1253 " /* Copy data into the shared memory object. */\n"
1254 "\\&\n"
1255 " shmp-E<gt>cnt = len;\n"
1256 " memcpy(&shmp-E<gt>buf, string, len);\n"
1257 "\\&\n"
1258 " /* Tell peer that it can now access shared memory. */\n"
1259 "\\&\n"
1260 " if (sem_post(&shmp-E<gt>sem1) == -1)\n"
1261 " errExit(\"sem_post\");\n"
1262 "\\&\n"
1263 " /* Wait until peer says that it has finished accessing\n"
1264 " the shared memory. */\n"
1265 "\\&\n"
1266 " if (sem_wait(&shmp-E<gt>sem2) == -1)\n"
1267 " errExit(\"sem_wait\");\n"
1268 "\\&\n"
1269 " /* Write modified data in shared memory to standard output. */\n"
1270 "\\&\n"
1271 " if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n"
1272 " errExit(\"write\");\n"
1273 " if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n"
1274 " errExit(\"write\");\n"
1275 "\\&\n"
1276 " exit(EXIT_SUCCESS);\n"
1277 "}\n"
1278 msgstr ""
1279
1280 #. type: TH
1281 #: mageia-cauldron
1282 #, no-wrap
1283 msgid "Linux man-pages 6.17"
1284 msgstr "Страницы руководства Linux 6.17"
1285
1286 #. type: TH
1287 #: opensuse-leap-16-1 opensuse-tumbleweed
1288 #, no-wrap
1289 msgid "Linux man-pages (unreleased)"
1290 msgstr "Страницы руководства Linux (не выпущены)"