| 1 |
# Arabic translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# زايد السعيدي <[email protected]>, 2026. |
| 5 |
msgid "" |
| 6 |
msgstr "" |
| 7 |
"Project-Id-Version: manpages-l10n 4.30.2\n" |
| 8 |
"POT-Creation-Date: 2026-06-05 06:43+0200\n" |
| 9 |
"PO-Revision-Date: 2026-06-03 18:13+0400\n" |
| 10 |
"Last-Translator: Zayed Al-Saidi <[email protected]>\n" |
| 11 |
"Language-Team: Arabic <[email protected]>\n" |
| 12 |
"Language: ar\n" |
| 13 |
"MIME-Version: 1.0\n" |
| 14 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 15 |
"Content-Transfer-Encoding: 8bit\n" |
| 16 |
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " |
| 17 |
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" |
| 18 |
"X-Generator: Lokalize 23.08.5\n" |
| 19 |
|
| 20 |
#. type: TH |
| 21 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 22 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 23 |
#, no-wrap |
| 24 |
msgid "shm_open" |
| 25 |
msgstr "shm_open" |
| 26 |
|
| 27 |
#. type: TH |
| 28 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 29 |
#: opensuse-tumbleweed |
| 30 |
#, no-wrap |
| 31 |
msgid "2026-02-08" |
| 32 |
msgstr "8 فبراير 2026" |
| 33 |
|
| 34 |
#. type: TH |
| 35 |
#: archlinux debian-unstable |
| 36 |
#, no-wrap |
| 37 |
msgid "Linux man-pages 6.18" |
| 38 |
msgstr "صفحات دليل لينكس 6.18" |
| 39 |
|
| 40 |
#. type: SH |
| 41 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 42 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 43 |
#, no-wrap |
| 44 |
msgid "NAME" |
| 45 |
msgstr "الاسم" |
| 46 |
|
| 47 |
#. type: Plain text |
| 48 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 49 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 50 |
msgid "" |
| 51 |
"shm_open, shm_unlink - create/open or unlink POSIX shared memory objects" |
| 52 |
msgstr "shm_open, shm_unlink - إنشاء/فتح أو فصل كائنات الذاكرة المشتركة POSIX" |
| 53 |
|
| 54 |
#. type: SH |
| 55 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 56 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 57 |
#, no-wrap |
| 58 |
msgid "LIBRARY" |
| 59 |
msgstr "المكتبة" |
| 60 |
|
| 61 |
#. type: Plain text |
| 62 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 63 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 64 |
msgid "Real-time library (I<librt>,\\ I<-lrt>)" |
| 65 |
msgstr "مكتبة الوقت الحقيقي (I<librt>،\\ I<-lrt>)" |
| 66 |
|
| 67 |
#. type: SH |
| 68 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 69 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 70 |
#, no-wrap |
| 71 |
msgid "SYNOPSIS" |
| 72 |
msgstr "موجز" |
| 73 |
|
| 74 |
#. type: Plain text |
| 75 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 76 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 77 |
#, no-wrap |
| 78 |
msgid "" |
| 79 |
"B<#include E<lt>sys/mman.hE<gt>>\n" |
| 80 |
"B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n" |
| 81 |
"B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n" |
| 82 |
msgstr "" |
| 83 |
"B<#include E<lt>sys/mman.hE<gt>>\n" |
| 84 |
"B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n" |
| 85 |
"B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n" |
| 86 |
|
| 87 |
#. type: Plain text |
| 88 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 89 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 90 |
#, no-wrap |
| 91 |
msgid "" |
| 92 |
"B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>\n" |
| 93 |
"B<int shm_unlink(const char *>I<name>B<);>\n" |
| 94 |
msgstr "" |
| 95 |
"B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>\n" |
| 96 |
"B<int shm_unlink(const char *>I<name>B<);>\n" |
| 97 |
|
| 98 |
#. type: SH |
| 99 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 100 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 101 |
#, no-wrap |
| 102 |
msgid "DESCRIPTION" |
| 103 |
msgstr "الوصف" |
| 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 |
msgid "" |
| 109 |
"B<shm_open>() creates and opens a new, or opens an existing, POSIX shared " |
| 110 |
"memory object. A POSIX shared memory object is in effect a handle which can " |
| 111 |
"be used by unrelated processes to B<mmap>(2) the same region of shared " |
| 112 |
"memory. The B<shm_unlink>() function performs the converse operation, " |
| 113 |
"removing an object previously created by B<shm_open>()." |
| 114 |
msgstr "" |
| 115 |
"تنشئ وتفتح الدالة B<shm_open>() كائن ذاكرة مشتركة POSIX جديدًا، أو تفتح كائنًا " |
| 116 |
"موجودًا. كائن الذاكرة المشتركة POSIX هو في الواقع مقبض يمكن استخدامه بواسطة " |
| 117 |
"عمليات غير مرتبطة لـ B<mmap>(2) نفس منطقة الذاكرة المشتركة. تؤدي الدالة " |
| 118 |
"B<shm_unlink>() العملية المعاكسة، بإزالة كائن أُنشئ سابقًا بواسطة " |
| 119 |
"B<shm_open>()." |
| 120 |
|
| 121 |
#. glibc allows the initial slash to be omitted, and makes |
| 122 |
#. multiple initial slashes equivalent to a single slash. |
| 123 |
#. This differs from the implementation of POSIX message queues. |
| 124 |
#. glibc allows subdirectory components in the name, in which |
| 125 |
#. case the subdirectory must exist under /dev/shm, and allow the |
| 126 |
#. required permissions if a user wants to create a shared memory |
| 127 |
#. object in that subdirectory. |
| 128 |
#. type: Plain text |
| 129 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 130 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 131 |
msgid "" |
| 132 |
"The operation of B<shm_open>() is analogous to that of B<open>(2). I<name> " |
| 133 |
"specifies the shared memory object to be created or opened. For portable " |
| 134 |
"use, a shared memory object should be identified by a name of the form I</" |
| 135 |
"somename>; that is, a null-terminated string of up to B<NAME_MAX> (i.e., " |
| 136 |
"255) characters consisting of an initial slash, followed by one or more " |
| 137 |
"characters, none of which are slashes." |
| 138 |
msgstr "" |
| 139 |
"عملية B<shm_open>() مماثلة لعملية B<open>(2). يحدد I<name> كائن الذاكرة " |
| 140 |
"المشتركة الذي سيُنشأ أو يُفتح. للاستخدام المحمول، يجب تعريف كائن الذاكرة " |
| 141 |
"المشتركة باسم من الشكل I</somename>؛ أي سلسلة محارف منتهية بقيمة خالية يصل " |
| 142 |
"طولها إلى B<NAME_MAX> (أي 255) حرفًا تتكون من شرطة مائلة أولية، متبوعة بحرف " |
| 143 |
"واحد أو أكثر، لا تحتوي أي منها على شرطات مائلة." |
| 144 |
|
| 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 |
"I<oflag> is a bit mask created by ORing together exactly one of B<O_RDONLY> " |
| 150 |
"or B<O_RDWR> and any of the other flags listed here:" |
| 151 |
msgstr "" |
| 152 |
"I<oflag> هو قناع بتات يُنشأ بواسطة ORing معًا واحدًا بالضبط من B<O_RDONLY> أو " |
| 153 |
"B<O_RDWR> وأي من الأعلام الأخرى المدرجة هنا:" |
| 154 |
|
| 155 |
#. type: TP |
| 156 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 157 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 158 |
#, no-wrap |
| 159 |
msgid "B<O_RDONLY>" |
| 160 |
msgstr "B<O_RDONLY>" |
| 161 |
|
| 162 |
#. type: Plain text |
| 163 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 164 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 165 |
msgid "" |
| 166 |
"Open the object for read access. A shared memory object opened in this way " |
| 167 |
"can be B<mmap>(2)ed only for read (B<PROT_READ>) access." |
| 168 |
msgstr "" |
| 169 |
"يفتح الكائن للوصول للقراءة. يمكن لكائن الذاكرة المشتركة المفتوح بهذه الطريقة " |
| 170 |
"أن يُوصل بـ B<mmap>(2) فقط للوصول للقراءة (B<PROT_READ>)." |
| 171 |
|
| 172 |
#. type: TP |
| 173 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 174 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 175 |
#, no-wrap |
| 176 |
msgid "B<O_RDWR>" |
| 177 |
msgstr "B<O_RDWR>" |
| 178 |
|
| 179 |
#. type: Plain text |
| 180 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 181 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 182 |
msgid "Open the object for read-write access." |
| 183 |
msgstr "يفتح الكائن للوصول للقراءة والكتابة." |
| 184 |
|
| 185 |
#. type: TP |
| 186 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 187 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 188 |
#, no-wrap |
| 189 |
msgid "B<O_CREAT>" |
| 190 |
msgstr "B<O_CREAT>" |
| 191 |
|
| 192 |
#. In truth it is actually the filesystem IDs on Linux, but these |
| 193 |
#. are nearly always the same as the effective IDs. (MTK, Jul 05) |
| 194 |
#. type: Plain text |
| 195 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 196 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 197 |
msgid "" |
| 198 |
"Create the shared memory object if it does not exist. The user and group " |
| 199 |
"ownership of the object are taken from the corresponding effective IDs of " |
| 200 |
"the calling process, and the object's permission bits are set according to " |
| 201 |
"the low-order 9 bits of I<mode>, except that those bits set in the process " |
| 202 |
"file mode creation mask (see B<umask>(2)) are cleared for the new object. " |
| 203 |
"A set of macro constants which can be used to define I<mode> is listed in " |
| 204 |
"B<open>(2). (Symbolic definitions of these constants can be obtained by " |
| 205 |
"including I<E<lt>sys/stat.hE<gt>>.)" |
| 206 |
msgstr "" |
| 207 |
"ينشئ كائن الذاكرة المشتركة إذا لم يكن موجودًا. تُؤخذ ملكية المستخدم والمجموعة " |
| 208 |
"للكائن من المعرفات الفعالة المقابلة للعملية المستدعية، وتُضبط أذونات الكائن " |
| 209 |
"وفقًا للبتات التسع السفلى من I<mode>، باستثناء أن تلك البتات المضبوطة في قناع " |
| 210 |
"إنشاء وضع ملف العملية (انظر B<umask>(2)) تُمسح للكائن الجديد. مجموعة من ثوابت " |
| 211 |
"الماكرو التي يمكن استخدامها لتعريف I<mode> مدرجة في B<open>(2). (يمكن الحصول " |
| 212 |
"على التعريفات الرمزية لهذه الثوابت بتضمين I<E<lt>sys/stat.hE<gt>>.)" |
| 213 |
|
| 214 |
#. type: Plain text |
| 215 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 216 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 217 |
msgid "" |
| 218 |
"A new shared memory object initially has zero length\\[em]the size of the " |
| 219 |
"object can be set using B<ftruncate>(2). The newly allocated bytes of a " |
| 220 |
"shared memory object are automatically initialized to 0." |
| 221 |
msgstr "" |
| 222 |
"كائن الذاكرة المشتركة الجديد له طول صفري مبدئيًا\\[em]يمكن ضبط حجم الكائن " |
| 223 |
"باستخدام B<ftruncate>(2). البايتات المخصصة حديثًا لكائن الذاكرة المشتركة تُهيأ " |
| 224 |
"آلي إلى 0." |
| 225 |
|
| 226 |
#. type: TP |
| 227 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 228 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 229 |
#, no-wrap |
| 230 |
msgid "B<O_EXCL>" |
| 231 |
msgstr "B<O_EXCL>" |
| 232 |
|
| 233 |
#. type: Plain text |
| 234 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 235 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 236 |
msgid "" |
| 237 |
"If B<O_CREAT> was also specified, and a shared memory object with the given " |
| 238 |
"I<name> already exists, return an error. The check for the existence of the " |
| 239 |
"object, and its creation if it does not exist, are performed atomically." |
| 240 |
msgstr "" |
| 241 |
"إذا حُدد B<O_CREAT> أيضًا، وكان كائن ذاكرة مشتركة بالاسم I<name> المعطى موجودًا " |
| 242 |
"بالفعل، يُرجع خطأ. التحقق من وجود الكائن، وإنشاؤه إذا لم يكن موجودًا، يُنفذان " |
| 243 |
"ذريًا." |
| 244 |
|
| 245 |
#. type: TP |
| 246 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 247 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 248 |
#, no-wrap |
| 249 |
msgid "B<O_TRUNC>" |
| 250 |
msgstr "B<O_TRUNC>" |
| 251 |
|
| 252 |
#. type: Plain text |
| 253 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 254 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 255 |
msgid "If the shared memory object already exists, truncate it to zero bytes." |
| 256 |
msgstr "إذا كان كائن الذاكرة المشتركة موجودًا بالفعل، يُقتص إلى صفر بايت." |
| 257 |
|
| 258 |
#. type: Plain text |
| 259 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 260 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 261 |
msgid "" |
| 262 |
"Definitions of these flag values can be obtained by including I<E<lt>fcntl." |
| 263 |
"hE<gt>>." |
| 264 |
msgstr "يمكن الحصول على تعريفات قيم الأعلام هذه بتضمين I<E<lt>fcntl.hE<gt>>." |
| 265 |
|
| 266 |
#. type: Plain text |
| 267 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 268 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 269 |
msgid "" |
| 270 |
"On successful completion B<shm_open>() returns a new file descriptor " |
| 271 |
"referring to the shared memory object. This file descriptor is guaranteed " |
| 272 |
"to be the lowest-numbered file descriptor not previously opened within the " |
| 273 |
"process. The B<FD_CLOEXEC> flag (see B<fcntl>(2)) is set for the file " |
| 274 |
"descriptor." |
| 275 |
msgstr "" |
| 276 |
"عند الإكمال الناجح، تُرجع B<shm_open>() واصف ملف جديد يشير إلى كائن الذاكرة " |
| 277 |
"المشتركة. يُضمن أن واصف الملف هذا هو واصف الملف ذو الرقم الأدنى الذي لم يُفتح " |
| 278 |
"سابقًا داخل العملية. يُضبط العلم B<FD_CLOEXEC> (انظر B<fcntl>(2)) لواصف الملف." |
| 279 |
|
| 280 |
#. type: Plain text |
| 281 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 282 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 283 |
msgid "" |
| 284 |
"The file descriptor is normally used in subsequent calls to B<ftruncate>(2) " |
| 285 |
"(for a newly created object) and B<mmap>(2). After a call to B<mmap>(2) " |
| 286 |
"the file descriptor may be closed without affecting the memory mapping." |
| 287 |
msgstr "" |
| 288 |
"يُستخدم واصف الملف عادةً في الاستدعاءات اللاحقة لـ B<ftruncate>(2) (لكائن منشأ " |
| 289 |
"حديثًا) و B<mmap>(2). بعد استدعاء B<mmap>(2)، يمكن إغلاق واصف الملف دون " |
| 290 |
"التأثير على تعيين الذاكرة." |
| 291 |
|
| 292 |
#. type: Plain text |
| 293 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 294 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 295 |
msgid "" |
| 296 |
"The operation of B<shm_unlink>() is analogous to B<unlink>(2): it removes a " |
| 297 |
"shared memory object name, and, once all processes have unmapped the object, " |
| 298 |
"deallocates and destroys the contents of the associated memory region. " |
| 299 |
"After a successful B<shm_unlink>(), attempts to B<shm_open>() an object " |
| 300 |
"with the same I<name> fail (unless B<O_CREAT> was specified, in which case a " |
| 301 |
"new, distinct object is created)." |
| 302 |
msgstr "" |
| 303 |
"عملية B<shm_unlink>() مماثلة لـ B<unlink>(2): تزيل اسم كائن الذاكرة " |
| 304 |
"المشتركة، وبمجرد أن تلغي جميع العمليات تعيين الكائن، تُحرر وتدمر محتويات " |
| 305 |
"منطقة الذاكرة المرتبطة. بعد B<shm_unlink>() ناجح، تفشل محاولات B<shm_open>() " |
| 306 |
"لكائن بنفس I<name> (ما لم يُحدد B<O_CREAT>، وفي هذه الحالة يُنشأ كائن جديد " |
| 307 |
"ومتميز)." |
| 308 |
|
| 309 |
#. type: SH |
| 310 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 311 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 312 |
#, no-wrap |
| 313 |
msgid "RETURN VALUE" |
| 314 |
msgstr "قيمة الإرجاع" |
| 315 |
|
| 316 |
#. type: Plain text |
| 317 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 318 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 319 |
msgid "" |
| 320 |
"On success, B<shm_open>() returns a file descriptor (a nonnegative " |
| 321 |
"integer). On success, B<shm_unlink>() returns 0. On failure, both " |
| 322 |
"functions return -1 and set I<errno> to indicate the error." |
| 323 |
msgstr "" |
| 324 |
"عند النجاح، تُرجع B<shm_open>() واصف ملف (عدد صحيح غير سالب). عند النجاح، " |
| 325 |
"تُرجع B<shm_unlink>() 0. عند الفشل، تُرجع كلتا الدالتين -1 وتضبط I<errno> " |
| 326 |
"للإشارة إلى الخطأ." |
| 327 |
|
| 328 |
#. type: SH |
| 329 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 330 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 331 |
#, no-wrap |
| 332 |
msgid "ERRORS" |
| 333 |
msgstr "الأخطاء" |
| 334 |
|
| 335 |
#. type: TP |
| 336 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 337 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 338 |
#, no-wrap |
| 339 |
msgid "B<EACCES>" |
| 340 |
msgstr "B<EACCES>" |
| 341 |
|
| 342 |
#. type: Plain text |
| 343 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 344 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 345 |
msgid "Permission to B<shm_unlink>() the shared memory object was denied." |
| 346 |
msgstr "رُفض الإذن لـ B<shm_unlink>() لكائن الذاكرة المشتركة." |
| 347 |
|
| 348 |
#. type: Plain text |
| 349 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 350 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 351 |
msgid "" |
| 352 |
"Permission was denied to B<shm_open>() I<name> in the specified I<mode>, or " |
| 353 |
"B<O_TRUNC> was specified and the caller does not have write permission on " |
| 354 |
"the object." |
| 355 |
msgstr "" |
| 356 |
"رُفض الإذن لـ B<shm_open>() I<name> في I<mode> المحدد، أو حُدد B<O_TRUNC> وليس " |
| 357 |
"للمستدعي إذن كتابة على الكائن." |
| 358 |
|
| 359 |
#. type: TP |
| 360 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 361 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 362 |
#, no-wrap |
| 363 |
msgid "B<EEXIST>" |
| 364 |
msgstr "B<EEXIST>" |
| 365 |
|
| 366 |
#. type: Plain text |
| 367 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 368 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 369 |
msgid "" |
| 370 |
"Both B<O_CREAT> and B<O_EXCL> were specified to B<shm_open>() and the " |
| 371 |
"shared memory object specified by I<name> already exists." |
| 372 |
msgstr "" |
| 373 |
"حُدد كل من B<O_CREAT> و B<O_EXCL> لـ B<shm_open>() وكائن الذاكرة المشتركة " |
| 374 |
"المحدد بواسطة I<name> موجود بالفعل." |
| 375 |
|
| 376 |
#. type: TP |
| 377 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 378 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 379 |
#, no-wrap |
| 380 |
msgid "B<EINVAL>" |
| 381 |
msgstr "B<EINVAL>" |
| 382 |
|
| 383 |
#. type: Plain text |
| 384 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 385 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 386 |
msgid "The I<name> argument to B<shm_open>() was invalid." |
| 387 |
msgstr "وسيطة I<name> للدالة B<shm_open>() كانت غير صالحة." |
| 388 |
|
| 389 |
#. type: TP |
| 390 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 391 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 392 |
#, no-wrap |
| 393 |
msgid "B<EMFILE>" |
| 394 |
msgstr "B<EMFILE>" |
| 395 |
|
| 396 |
#. type: Plain text |
| 397 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 398 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 399 |
msgid "" |
| 400 |
"The per-process limit on the number of open file descriptors has been " |
| 401 |
"reached." |
| 402 |
msgstr "وُصل إلى الحد الأقصى لواصفات الملفات المفتوحة لكل عملية." |
| 403 |
|
| 404 |
#. type: TP |
| 405 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 406 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 407 |
#, no-wrap |
| 408 |
msgid "B<ENAMETOOLONG>" |
| 409 |
msgstr "B<ENAMETOOLONG>" |
| 410 |
|
| 411 |
#. type: Plain text |
| 412 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 413 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 414 |
msgid "The length of I<name> exceeds B<PATH_MAX>." |
| 415 |
msgstr "طول I<name> يتجاوز B<PATH_MAX>." |
| 416 |
|
| 417 |
#. type: TP |
| 418 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 419 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 420 |
#, no-wrap |
| 421 |
msgid "B<ENFILE>" |
| 422 |
msgstr "B<ENFILE>" |
| 423 |
|
| 424 |
#. type: Plain text |
| 425 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 426 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 427 |
msgid "" |
| 428 |
"The system-wide limit on the total number of open files has been reached." |
| 429 |
msgstr "وُصل إلى الحد الأقصى لإجمالي عدد الملفات المفتوحة على مستوى النظام." |
| 430 |
|
| 431 |
#. type: TP |
| 432 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 433 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 434 |
#, no-wrap |
| 435 |
msgid "B<ENOENT>" |
| 436 |
msgstr "B<ENOENT>" |
| 437 |
|
| 438 |
#. type: Plain text |
| 439 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 440 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 441 |
msgid "" |
| 442 |
"An attempt was made to B<shm_open>() a I<name> that did not exist, and " |
| 443 |
"B<O_CREAT> was not specified." |
| 444 |
msgstr "" |
| 445 |
"جرت محاولة لاستدعاء B<shm_open>() على I<name> غير موجود، ولم يُحدد " |
| 446 |
"B<O_CREAT>." |
| 447 |
|
| 448 |
#. type: Plain text |
| 449 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 450 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 451 |
msgid "" |
| 452 |
"An attempt was to made to B<shm_unlink>() a I<name> that does not exist." |
| 453 |
msgstr "جرت محاولة لاستدعاء B<shm_unlink>() على I<name> غير موجود." |
| 454 |
|
| 455 |
#. type: SH |
| 456 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 457 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 458 |
#, no-wrap |
| 459 |
msgid "ATTRIBUTES" |
| 460 |
msgstr "السمات" |
| 461 |
|
| 462 |
#. type: Plain text |
| 463 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 464 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 465 |
msgid "" |
| 466 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 467 |
msgstr "" |
| 468 |
"للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)." |
| 469 |
|
| 470 |
#. type: tbl table |
| 471 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 472 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 473 |
#, no-wrap |
| 474 |
msgid "Interface" |
| 475 |
msgstr "الواجهة" |
| 476 |
|
| 477 |
#. type: tbl table |
| 478 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 479 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 480 |
#, no-wrap |
| 481 |
msgid "Attribute" |
| 482 |
msgstr "السمة" |
| 483 |
|
| 484 |
#. type: tbl table |
| 485 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 486 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 487 |
#, no-wrap |
| 488 |
msgid "Value" |
| 489 |
msgstr "القيمة" |
| 490 |
|
| 491 |
#. type: tbl table |
| 492 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 493 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 494 |
#, no-wrap |
| 495 |
msgid ".na\n" |
| 496 |
msgstr ".na\n" |
| 497 |
|
| 498 |
#. type: tbl table |
| 499 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 500 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 501 |
#, no-wrap |
| 502 |
msgid ".nh\n" |
| 503 |
msgstr ".nh\n" |
| 504 |
|
| 505 |
#. type: tbl table |
| 506 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 507 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 508 |
#, no-wrap |
| 509 |
msgid "" |
| 510 |
"B<shm_open>(),\n" |
| 511 |
"B<shm_unlink>()" |
| 512 |
msgstr "" |
| 513 |
"B<shm_open>(),\n" |
| 514 |
"B<shm_unlink>()" |
| 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 "Thread safety" |
| 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 "MT-Safe locale" |
| 528 |
msgstr "المنطقة (locale) آمنة لتعدد المسالك (MT-Safe)" |
| 529 |
|
| 530 |
#. type: SH |
| 531 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 532 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 533 |
#, no-wrap |
| 534 |
msgid "VERSIONS" |
| 535 |
msgstr "الإصدارات" |
| 536 |
|
| 537 |
#. type: Plain text |
| 538 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 539 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 540 |
msgid "" |
| 541 |
"POSIX leaves the behavior of the combination of B<O_RDONLY> and B<O_TRUNC> " |
| 542 |
"unspecified. On Linux, this will successfully truncate an existing shared " |
| 543 |
"memory object\\[em]this may not be so on other UNIX systems." |
| 544 |
msgstr "" |
| 545 |
"يترك POSIX سلوك الجمع بين B<O_RDONLY> و B<O_TRUNC> غير محدد. في لينكس، سيؤدي " |
| 546 |
"هذا إلى اقتطاع كائن ذاكرة مشتركة موجود بنجاح\\[em]قد لا يكون هذا هو الحال في " |
| 547 |
"أنظمة UNIX الأخرى." |
| 548 |
|
| 549 |
#. type: Plain text |
| 550 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 551 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 552 |
msgid "" |
| 553 |
"The POSIX shared memory object implementation on Linux makes use of a " |
| 554 |
"dedicated B<tmpfs>(5) filesystem that is normally mounted under I</dev/shm>." |
| 555 |
msgstr "" |
| 556 |
"يستخدم تطبيق كائن الذاكرة المشتركة POSIX في لينكس نظام ملفات B<tmpfs>(5) " |
| 557 |
"مخصص يُوصل عادة تحت I</dev/shm>." |
| 558 |
|
| 559 |
#. type: SH |
| 560 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 561 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 562 |
#, no-wrap |
| 563 |
msgid "STANDARDS" |
| 564 |
msgstr "المعايير" |
| 565 |
|
| 566 |
#. type: Plain text |
| 567 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 568 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 569 |
msgid "POSIX.1-2008." |
| 570 |
msgstr "POSIX.1-2008." |
| 571 |
|
| 572 |
#. type: SH |
| 573 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 574 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 575 |
#, no-wrap |
| 576 |
msgid "HISTORY" |
| 577 |
msgstr "التاريخ" |
| 578 |
|
| 579 |
#. type: Plain text |
| 580 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 581 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 582 |
msgid "glibc 2.2. POSIX.1-2001." |
| 583 |
msgstr "glibc 2.2. POSIX.1-2001." |
| 584 |
|
| 585 |
#. type: Plain text |
| 586 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 587 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 588 |
msgid "" |
| 589 |
"POSIX.1-2001 says that the group ownership of a newly created shared memory " |
| 590 |
"object is set to either the calling process's effective group ID or \"a " |
| 591 |
"system default group ID\". POSIX.1-2008 says that the group ownership may " |
| 592 |
"be set to either the calling process's effective group ID or, if the object " |
| 593 |
"is visible in the filesystem, the group ID of the parent directory." |
| 594 |
msgstr "" |
| 595 |
"ينص POSIX.1-2001 على أن ملكية المجموعة لكائن ذاكرة مشتركة مُنشأ حديثًا تُضبط " |
| 596 |
"إما على معرف المجموعة الفعّال للعملية المستدعية أو \"معرف مجموعة مبدئي " |
| 597 |
"للنظام\". ينص POSIX.1-2008 على أن ملكية المجموعة قد تُضبط إما على معرف " |
| 598 |
"المجموعة الفعّال للعملية المستدعية أو، إذا كان الكائن مرئيًا في نظام الملفات، " |
| 599 |
"معرف مجموعة الدليل الأصلي." |
| 600 |
|
| 601 |
#. type: SH |
| 602 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 603 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 604 |
#, no-wrap |
| 605 |
msgid "EXAMPLES" |
| 606 |
msgstr "أمثلة" |
| 607 |
|
| 608 |
#. type: Plain text |
| 609 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 610 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 611 |
msgid "" |
| 612 |
"The programs below employ POSIX shared memory and POSIX unnamed semaphores " |
| 613 |
"to exchange a piece of data. The \"bounce\" program (which must be run " |
| 614 |
"first) raises the case of a string that is placed into the shared memory by " |
| 615 |
"the \"send\" program. Once the data has been modified, the \"send\" program " |
| 616 |
"then prints the contents of the modified shared memory. An example " |
| 617 |
"execution of the two programs is the following:" |
| 618 |
msgstr "" |
| 619 |
"تستخدم البرامج أدناه الذاكرة المشتركة POSIX والإشارات غير المسماة POSIX " |
| 620 |
"لتبادل قطعة من البيانات. برنامج \"bounce\" (الذي يجب تشغيله أولاً) يرفع حالة " |
| 621 |
"سلسلة محارف تُوضع في الذاكرة المشتركة بواسطة برنامج \"send\". بمجرد تعديل " |
| 622 |
"البيانات، يطبع برنامج \"send\" محتويات الذاكرة المشتركة المعدلة. مثال على " |
| 623 |
"تنفيذ البرنامجين هو التالي:" |
| 624 |
|
| 625 |
#. type: Plain text |
| 626 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 627 |
#: opensuse-tumbleweed |
| 628 |
#, no-wrap |
| 629 |
msgid "" |
| 630 |
"$B< ./pshm_ucase_bounce /myshm &>\n" |
| 631 |
"[1] 270171\n" |
| 632 |
"$B< ./pshm_ucase_send /myshm hello>;\n" |
| 633 |
"HELLO\n" |
| 634 |
msgstr "" |
| 635 |
"$B< ./pshm_ucase_bounce /myshm &>\n" |
| 636 |
"[1] 270171\n" |
| 637 |
"$B< ./pshm_ucase_send /myshm hello>;\n" |
| 638 |
"HELLO\n" |
| 639 |
|
| 640 |
#. type: Plain text |
| 641 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 642 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 643 |
msgid "Further detail about these programs is provided below." |
| 644 |
msgstr "يُقدم تفصيل إضافي حول هذه البرامج أدناه." |
| 645 |
|
| 646 |
#. type: SS |
| 647 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 648 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 649 |
#, no-wrap |
| 650 |
msgid "Program source: pshm_ucase.h" |
| 651 |
msgstr "مصدر البرنامج: pshm_ucase.h" |
| 652 |
|
| 653 |
#. type: Plain text |
| 654 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 655 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 656 |
msgid "" |
| 657 |
"The following header file is included by both programs below. Its primary " |
| 658 |
"purpose is to define a structure that will be imposed on the memory object " |
| 659 |
"that is shared between the two programs." |
| 660 |
msgstr "" |
| 661 |
"يُضمن ملف الرأس التالي بواسطة كلا البرنامجين أدناه. غرضه الرئيسي هو تعريف " |
| 662 |
"بنية ستُفرض على كائن الذاكرة المشترك بين البرنامجين." |
| 663 |
|
| 664 |
#. type: Plain text |
| 665 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 666 |
#: opensuse-tumbleweed |
| 667 |
#, no-wrap |
| 668 |
msgid "" |
| 669 |
"#ifndef PSHM_UCASE_H\n" |
| 670 |
"#define PSHM_UCASE_H\n" |
| 671 |
"\\&\n" |
| 672 |
"#include E<lt>err.hE<gt>\n" |
| 673 |
"#include E<lt>semaphore.hE<gt>\n" |
| 674 |
"#include E<lt>stddef.hE<gt>\n" |
| 675 |
"#include E<lt>stdio.hE<gt>\n" |
| 676 |
"#include E<lt>stdlib.hE<gt>\n" |
| 677 |
"\\&\n" |
| 678 |
"#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n" |
| 679 |
"\\&\n" |
| 680 |
"/* Define a structure that will be imposed on the shared\n" |
| 681 |
" memory object */\n" |
| 682 |
"\\&\n" |
| 683 |
"struct shmbuf {\n" |
| 684 |
" sem_t sem1; /* POSIX unnamed semaphore */\n" |
| 685 |
" sem_t sem2; /* POSIX unnamed semaphore */\n" |
| 686 |
" size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n" |
| 687 |
" char buf[BUF_SIZE]; /* Data being transferred */\n" |
| 688 |
"};\n" |
| 689 |
"\\&\n" |
| 690 |
"#endif // include guard\n" |
| 691 |
msgstr "" |
| 692 |
"#ifndef PSHM_UCASE_H\n" |
| 693 |
"#define PSHM_UCASE_H\n" |
| 694 |
"\\&\n" |
| 695 |
"#include E<lt>err.hE<gt>\n" |
| 696 |
"#include E<lt>semaphore.hE<gt>\n" |
| 697 |
"#include E<lt>stddef.hE<gt>\n" |
| 698 |
"#include E<lt>stdio.hE<gt>\n" |
| 699 |
"#include E<lt>stdlib.hE<gt>\n" |
| 700 |
"\\&\n" |
| 701 |
"#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n" |
| 702 |
"\\&\n" |
| 703 |
"/* Define a structure that will be imposed on the shared\n" |
| 704 |
" memory object */\n" |
| 705 |
"\\&\n" |
| 706 |
"struct shmbuf {\n" |
| 707 |
" sem_t sem1; /* POSIX unnamed semaphore */\n" |
| 708 |
" sem_t sem2; /* POSIX unnamed semaphore */\n" |
| 709 |
" size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n" |
| 710 |
" char buf[BUF_SIZE]; /* Data being transferred */\n" |
| 711 |
"};\n" |
| 712 |
"\\&\n" |
| 713 |
"#endif // include guard\n" |
| 714 |
|
| 715 |
#. type: SS |
| 716 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 717 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 718 |
#, no-wrap |
| 719 |
msgid "Program source: pshm_ucase_bounce.c" |
| 720 |
msgstr "مصدر البرنامج: pshm_ucase_bounce.c" |
| 721 |
|
| 722 |
#. type: Plain text |
| 723 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 724 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 725 |
msgid "" |
| 726 |
"The \"bounce\" program creates a new shared memory object with the name " |
| 727 |
"given in its command-line argument and sizes the object to match the size of " |
| 728 |
"the I<shmbuf> structure defined in the header file. It then maps the object " |
| 729 |
"into the process's address space, and initializes two POSIX semaphores " |
| 730 |
"inside the object to 0." |
| 731 |
msgstr "" |
| 732 |
"ينشئ برنامج \"bounce\" كائن ذاكرة مشتركة جديدًا بالاسم المُعطى في وسيطة سطر " |
| 733 |
"الأوامر ويُحدد حجم الكائن ليطابق حجم بنية I<shmbuf> المُعرفة في ملف الرأس. ثم " |
| 734 |
"يُخطط الكائن في مساحة عناوين العملية، ويُهيئ إشارتين POSIX داخل الكائن إلى 0." |
| 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 |
"After the \"send\" program has posted the first of the semaphores, the " |
| 741 |
"\"bounce\" program upper cases the data that has been placed in the memory " |
| 742 |
"by the \"send\" program and then posts the second semaphore to tell the " |
| 743 |
"\"send\" program that it may now access the shared memory." |
| 744 |
msgstr "" |
| 745 |
"بعد أن يُرسل برنامج \"send\" أول إشارة، يرفع برنامج \"bounce\" حالة البيانات " |
| 746 |
"التي وُضعت في الذاكرة بواسطة برنامج \"send\" ثم يُرسل الإشارة الثانية ليُخبر " |
| 747 |
"برنامج \"send\" أنه يمكنه الآن الوصول إلى الذاكرة المشتركة." |
| 748 |
|
| 749 |
#. type: Plain text |
| 750 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 751 |
#: opensuse-tumbleweed |
| 752 |
#, no-wrap |
| 753 |
msgid "" |
| 754 |
"/* pshm_ucase_bounce.c\n" |
| 755 |
"\\&\n" |
| 756 |
" Licensed under GNU General Public License v2 or later.\n" |
| 757 |
"*/\n" |
| 758 |
"#include E<lt>ctype.hE<gt>\n" |
| 759 |
"#include E<lt>fcntl.hE<gt>\n" |
| 760 |
"#include E<lt>stdio.hE<gt>\n" |
| 761 |
"#include E<lt>stdlib.hE<gt>\n" |
| 762 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 763 |
"#include E<lt>unistd.hE<gt>\n" |
| 764 |
"\\&\n" |
| 765 |
"#include \"pshm_ucase.h\"\n" |
| 766 |
"\\&\n" |
| 767 |
"int\n" |
| 768 |
"main(int argc, char *argv[])\n" |
| 769 |
"{\n" |
| 770 |
" int fd;\n" |
| 771 |
" char *shmpath;\n" |
| 772 |
" struct shmbuf *shmp;\n" |
| 773 |
"\\&\n" |
| 774 |
" if (argc != 2) {\n" |
| 775 |
" fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n" |
| 776 |
" exit(EXIT_FAILURE);\n" |
| 777 |
" }\n" |
| 778 |
"\\&\n" |
| 779 |
" shmpath = argv[1];\n" |
| 780 |
"\\&\n" |
| 781 |
" /* Create shared memory object and set its size to the size\n" |
| 782 |
" of our structure. */\n" |
| 783 |
"\\&\n" |
| 784 |
" fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n" |
| 785 |
" if (fd == -1)\n" |
| 786 |
" err(EXIT_FAILURE, \"shm_open\");\n" |
| 787 |
"\\&\n" |
| 788 |
" if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n" |
| 789 |
" err(EXIT_FAILURE, \"ftruncate\");\n" |
| 790 |
"\\&\n" |
| 791 |
" /* Map the object into the caller\\[aq]s address space. */\n" |
| 792 |
"\\&\n" |
| 793 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 794 |
" MAP_SHARED, fd, 0);\n" |
| 795 |
" if (shmp == MAP_FAILED)\n" |
| 796 |
" err(EXIT_FAILURE, \"mmap\");\n" |
| 797 |
"\\&\n" |
| 798 |
" /* Initialize semaphores as process-shared, with value 0. */\n" |
| 799 |
"\\&\n" |
| 800 |
" if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n" |
| 801 |
" err(EXIT_FAILURE, \"sem_init-sem1\");\n" |
| 802 |
" if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n" |
| 803 |
" err(EXIT_FAILURE, \"sem_init-sem2\");\n" |
| 804 |
"\\&\n" |
| 805 |
" /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n" |
| 806 |
" shared memory. */\n" |
| 807 |
"\\&\n" |
| 808 |
" if (sem_wait(&shmp-E<gt>sem1) == -1)\n" |
| 809 |
" err(EXIT_FAILURE, \"sem_wait\");\n" |
| 810 |
"\\&\n" |
| 811 |
" /* Convert data in shared memory into upper case. */\n" |
| 812 |
"\\&\n" |
| 813 |
" for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n" |
| 814 |
" shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n" |
| 815 |
"\\&\n" |
| 816 |
" /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n" |
| 817 |
" access the modified data in shared memory. */\n" |
| 818 |
"\\&\n" |
| 819 |
" if (sem_post(&shmp-E<gt>sem2) == -1)\n" |
| 820 |
" err(EXIT_FAILURE, \"sem_post\");\n" |
| 821 |
"\\&\n" |
| 822 |
" /* Unlink the shared memory object. Even if the peer process\n" |
| 823 |
" is still using the object, this is okay. The object will\n" |
| 824 |
" be removed only after all open references are closed. */\n" |
| 825 |
"\\&\n" |
| 826 |
" shm_unlink(shmpath);\n" |
| 827 |
"\\&\n" |
| 828 |
" exit(EXIT_SUCCESS);\n" |
| 829 |
"}\n" |
| 830 |
msgstr "" |
| 831 |
"/* pshm_ucase_bounce.c\n" |
| 832 |
"\\&\n" |
| 833 |
" Licensed under GNU General Public License v2 or later.\n" |
| 834 |
"*/\n" |
| 835 |
"#include E<lt>ctype.hE<gt>\n" |
| 836 |
"#include E<lt>fcntl.hE<gt>\n" |
| 837 |
"#include E<lt>stdio.hE<gt>\n" |
| 838 |
"#include E<lt>stdlib.hE<gt>\n" |
| 839 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 840 |
"#include E<lt>unistd.hE<gt>\n" |
| 841 |
"\\&\n" |
| 842 |
"#include \"pshm_ucase.h\"\n" |
| 843 |
"\\&\n" |
| 844 |
"int\n" |
| 845 |
"main(int argc, char *argv[])\n" |
| 846 |
"{\n" |
| 847 |
" int fd;\n" |
| 848 |
" char *shmpath;\n" |
| 849 |
" struct shmbuf *shmp;\n" |
| 850 |
"\\&\n" |
| 851 |
" if (argc != 2) {\n" |
| 852 |
" fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n" |
| 853 |
" exit(EXIT_FAILURE);\n" |
| 854 |
" }\n" |
| 855 |
"\\&\n" |
| 856 |
" shmpath = argv[1];\n" |
| 857 |
"\\&\n" |
| 858 |
" /* Create shared memory object and set its size to the size\n" |
| 859 |
" of our structure. */\n" |
| 860 |
"\\&\n" |
| 861 |
" fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n" |
| 862 |
" if (fd == -1)\n" |
| 863 |
" err(EXIT_FAILURE, \"shm_open\");\n" |
| 864 |
"\\&\n" |
| 865 |
" if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n" |
| 866 |
" err(EXIT_FAILURE, \"ftruncate\");\n" |
| 867 |
"\\&\n" |
| 868 |
" /* Map the object into the caller\\[aq]s address space. */\n" |
| 869 |
"\\&\n" |
| 870 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 871 |
" MAP_SHARED, fd, 0);\n" |
| 872 |
" if (shmp == MAP_FAILED)\n" |
| 873 |
" err(EXIT_FAILURE, \"mmap\");\n" |
| 874 |
"\\&\n" |
| 875 |
" /* Initialize semaphores as process-shared, with value 0. */\n" |
| 876 |
"\\&\n" |
| 877 |
" if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n" |
| 878 |
" err(EXIT_FAILURE, \"sem_init-sem1\");\n" |
| 879 |
" if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n" |
| 880 |
" err(EXIT_FAILURE, \"sem_init-sem2\");\n" |
| 881 |
"\\&\n" |
| 882 |
" /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n" |
| 883 |
" shared memory. */\n" |
| 884 |
"\\&\n" |
| 885 |
" if (sem_wait(&shmp-E<gt>sem1) == -1)\n" |
| 886 |
" err(EXIT_FAILURE, \"sem_wait\");\n" |
| 887 |
"\\&\n" |
| 888 |
" /* Convert data in shared memory into upper case. */\n" |
| 889 |
"\\&\n" |
| 890 |
" for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n" |
| 891 |
" shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n" |
| 892 |
"\\&\n" |
| 893 |
" /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n" |
| 894 |
" access the modified data in shared memory. */\n" |
| 895 |
"\\&\n" |
| 896 |
" if (sem_post(&shmp-E<gt>sem2) == -1)\n" |
| 897 |
" err(EXIT_FAILURE, \"sem_post\");\n" |
| 898 |
"\\&\n" |
| 899 |
" /* Unlink the shared memory object. Even if the peer process\n" |
| 900 |
" is still using the object, this is okay. The object will\n" |
| 901 |
" be removed only after all open references are closed. */\n" |
| 902 |
"\\&\n" |
| 903 |
" shm_unlink(shmpath);\n" |
| 904 |
"\\&\n" |
| 905 |
" exit(EXIT_SUCCESS);\n" |
| 906 |
"}\n" |
| 907 |
|
| 908 |
#. type: SS |
| 909 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 910 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 911 |
#, no-wrap |
| 912 |
msgid "Program source: pshm_ucase_send.c" |
| 913 |
msgstr "مصدر البرنامج: pshm_ucase_send.c" |
| 914 |
|
| 915 |
#. type: Plain text |
| 916 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 917 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 918 |
msgid "" |
| 919 |
"The \"send\" program takes two command-line arguments: the pathname of a " |
| 920 |
"shared memory object previously created by the \"bounce\" program and a " |
| 921 |
"string that is to be copied into that object." |
| 922 |
msgstr "" |
| 923 |
"يأخذ برنامج \"send\" وسيطتين لسطر الأوامر: اسم مسار كائن ذاكرة مشتركة مُنشأ " |
| 924 |
"سابقًا بواسطة برنامج \"bounce\" وسلسلة محارف ستُنسخ إلى ذلك الكائن." |
| 925 |
|
| 926 |
#. type: Plain text |
| 927 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 928 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 929 |
msgid "" |
| 930 |
"The program opens the shared memory object and maps the object into its " |
| 931 |
"address space. It then copies the data specified in its second argument " |
| 932 |
"into the shared memory, and posts the first semaphore, which tells the " |
| 933 |
"\"bounce\" program that it can now access that data. After the \"bounce\" " |
| 934 |
"program posts the second semaphore, the \"send\" program prints the contents " |
| 935 |
"of the shared memory on standard output." |
| 936 |
msgstr "" |
| 937 |
"يَفتَح البرنامج كائن الذاكرة المُشتركة ويَربِط الكائن في نطاق عناوينه. ثم يَنسَخ " |
| 938 |
"البيانات المُحدَّدة في وسيطه الثاني إلى الذاكرة المُشتركة، ويُطلِق الإشارة الأولى، " |
| 939 |
"التي تُخبِر برنامج \"الارتداد\" أنه يمكنه الآن الوصول إلى تلك البيانات. بعد أن " |
| 940 |
"يُطلِق برنامج \"الارتداد\" الإشارة الثانية، يَطبَع برنامج \"الإرسال\" محتويات " |
| 941 |
"الذاكرة المُشتركة على الخرج القياسي." |
| 942 |
|
| 943 |
#. type: Plain text |
| 944 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 945 |
#: opensuse-tumbleweed |
| 946 |
#, no-wrap |
| 947 |
msgid "" |
| 948 |
"/* pshm_ucase_send.c\n" |
| 949 |
"\\&\n" |
| 950 |
" Licensed under GNU General Public License v2 or later.\n" |
| 951 |
"*/\n" |
| 952 |
"#include E<lt>fcntl.hE<gt>\n" |
| 953 |
"#include E<lt>stddef.hE<gt>\n" |
| 954 |
"#include E<lt>stdio.hE<gt>\n" |
| 955 |
"#include E<lt>stdlib.hE<gt>\n" |
| 956 |
"#include E<lt>string.hE<gt>\n" |
| 957 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 958 |
"#include E<lt>unistd.hE<gt>\n" |
| 959 |
"\\&\n" |
| 960 |
"#include \"pshm_ucase.h\"\n" |
| 961 |
"\\&\n" |
| 962 |
"int\n" |
| 963 |
"main(int argc, char *argv[])\n" |
| 964 |
"{\n" |
| 965 |
" int fd;\n" |
| 966 |
" char *shmpath, *string;\n" |
| 967 |
" size_t len;\n" |
| 968 |
" struct shmbuf *shmp;\n" |
| 969 |
"\\&\n" |
| 970 |
" if (argc != 3) {\n" |
| 971 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 972 |
" exit(EXIT_FAILURE);\n" |
| 973 |
" }\n" |
| 974 |
"\\&\n" |
| 975 |
" shmpath = argv[1];\n" |
| 976 |
" string = argv[2];\n" |
| 977 |
" len = strlen(string);\n" |
| 978 |
"\\&\n" |
| 979 |
" if (len E<gt> BUF_SIZE) {\n" |
| 980 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 981 |
" exit(EXIT_FAILURE);\n" |
| 982 |
" }\n" |
| 983 |
"\\&\n" |
| 984 |
" /* Open the existing shared memory object and map it\n" |
| 985 |
" into the caller\\[aq]s address space. */\n" |
| 986 |
"\\&\n" |
| 987 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 988 |
" if (fd == -1)\n" |
| 989 |
" err(EXIT_FAILURE, \"shm_open\");\n" |
| 990 |
"\\&\n" |
| 991 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 992 |
" MAP_SHARED, fd, 0);\n" |
| 993 |
" if (shmp == MAP_FAILED)\n" |
| 994 |
" err(EXIT_FAILURE, \"mmap\");\n" |
| 995 |
"\\&\n" |
| 996 |
" /* Copy data into the shared memory object. */\n" |
| 997 |
"\\&\n" |
| 998 |
" shmp-E<gt>cnt = len;\n" |
| 999 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1000 |
"\\&\n" |
| 1001 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1002 |
"\\&\n" |
| 1003 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1004 |
" err(EXIT_FAILURE, \"sem_post\");\n" |
| 1005 |
"\\&\n" |
| 1006 |
" /* Wait until peer says that it has finished accessing\n" |
| 1007 |
" the shared memory. */\n" |
| 1008 |
"\\&\n" |
| 1009 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1010 |
" err(EXIT_FAILURE, \"sem_wait\");\n" |
| 1011 |
"\\&\n" |
| 1012 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1013 |
"\\&\n" |
| 1014 |
" if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n" |
| 1015 |
" err(EXIT_FAILURE, \"write\");\n" |
| 1016 |
" if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n" |
| 1017 |
" err(EXIT_FAILURE, \"write\");\n" |
| 1018 |
"\\&\n" |
| 1019 |
" exit(EXIT_SUCCESS);\n" |
| 1020 |
"}\n" |
| 1021 |
msgstr "" |
| 1022 |
"/* pshm_ucase_send.c\n" |
| 1023 |
"\\&\n" |
| 1024 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1025 |
"*/\n" |
| 1026 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1027 |
"#include E<lt>stddef.hE<gt>\n" |
| 1028 |
"#include E<lt>stdio.hE<gt>\n" |
| 1029 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1030 |
"#include E<lt>string.hE<gt>\n" |
| 1031 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1032 |
"#include E<lt>unistd.hE<gt>\n" |
| 1033 |
"\\&\n" |
| 1034 |
"#include \"pshm_ucase.h\"\n" |
| 1035 |
"\\&\n" |
| 1036 |
"int\n" |
| 1037 |
"main(int argc, char *argv[])\n" |
| 1038 |
"{\n" |
| 1039 |
" int fd;\n" |
| 1040 |
" char *shmpath, *string;\n" |
| 1041 |
" size_t len;\n" |
| 1042 |
" struct shmbuf *shmp;\n" |
| 1043 |
"\\&\n" |
| 1044 |
" if (argc != 3) {\n" |
| 1045 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 1046 |
" exit(EXIT_FAILURE);\n" |
| 1047 |
" }\n" |
| 1048 |
"\\&\n" |
| 1049 |
" shmpath = argv[1];\n" |
| 1050 |
" string = argv[2];\n" |
| 1051 |
" len = strlen(string);\n" |
| 1052 |
"\\&\n" |
| 1053 |
" if (len E<gt> BUF_SIZE) {\n" |
| 1054 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 1055 |
" exit(EXIT_FAILURE);\n" |
| 1056 |
" }\n" |
| 1057 |
"\\&\n" |
| 1058 |
" /* Open the existing shared memory object and map it\n" |
| 1059 |
" into the caller\\[aq]s address space. */\n" |
| 1060 |
"\\&\n" |
| 1061 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 1062 |
" if (fd == -1)\n" |
| 1063 |
" err(EXIT_FAILURE, \"shm_open\");\n" |
| 1064 |
"\\&\n" |
| 1065 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1066 |
" MAP_SHARED, fd, 0);\n" |
| 1067 |
" if (shmp == MAP_FAILED)\n" |
| 1068 |
" err(EXIT_FAILURE, \"mmap\");\n" |
| 1069 |
"\\&\n" |
| 1070 |
" /* Copy data into the shared memory object. */\n" |
| 1071 |
"\\&\n" |
| 1072 |
" shmp-E<gt>cnt = len;\n" |
| 1073 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1074 |
"\\&\n" |
| 1075 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1076 |
"\\&\n" |
| 1077 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1078 |
" err(EXIT_FAILURE, \"sem_post\");\n" |
| 1079 |
"\\&\n" |
| 1080 |
" /* Wait until peer says that it has finished accessing\n" |
| 1081 |
" the shared memory. */\n" |
| 1082 |
"\\&\n" |
| 1083 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1084 |
" err(EXIT_FAILURE, \"sem_wait\");\n" |
| 1085 |
"\\&\n" |
| 1086 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1087 |
"\\&\n" |
| 1088 |
" if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n" |
| 1089 |
" err(EXIT_FAILURE, \"write\");\n" |
| 1090 |
" if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n" |
| 1091 |
" err(EXIT_FAILURE, \"write\");\n" |
| 1092 |
"\\&\n" |
| 1093 |
" exit(EXIT_SUCCESS);\n" |
| 1094 |
"}\n" |
| 1095 |
|
| 1096 |
#. type: SH |
| 1097 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1098 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1099 |
#, no-wrap |
| 1100 |
msgid "SEE ALSO" |
| 1101 |
msgstr "انظر أيضًا" |
| 1102 |
|
| 1103 |
#. type: Plain text |
| 1104 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1105 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1106 |
msgid "" |
| 1107 |
"B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), " |
| 1108 |
"B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), " |
| 1109 |
"B<shm_overview>(7)" |
| 1110 |
msgstr "" |
| 1111 |
"B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), " |
| 1112 |
"B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), " |
| 1113 |
"B<shm_overview>(7)" |
| 1114 |
|
| 1115 |
#. type: TH |
| 1116 |
#: debian-trixie |
| 1117 |
#, no-wrap |
| 1118 |
msgid "2024-06-15" |
| 1119 |
msgstr "15 يونيو 2024" |
| 1120 |
|
| 1121 |
#. type: TH |
| 1122 |
#: debian-trixie |
| 1123 |
#, no-wrap |
| 1124 |
msgid "Linux man-pages 6.9.1" |
| 1125 |
msgstr "صفحات دليل لينكس 6.9.1" |
| 1126 |
|
| 1127 |
#. type: Plain text |
| 1128 |
#: debian-trixie |
| 1129 |
msgid "Real-time library (I<librt>, I<-lrt>)" |
| 1130 |
msgstr "مكتبة الوقت الحقيقي (I<librt>، I<-lrt>)" |
| 1131 |
|
| 1132 |
#. type: Plain text |
| 1133 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1134 |
#, no-wrap |
| 1135 |
msgid "" |
| 1136 |
"$ B<./pshm_ucase_bounce /myshm &>\n" |
| 1137 |
"[1] 270171\n" |
| 1138 |
"$ B<./pshm_ucase_send /myshm hello>\n" |
| 1139 |
"HELLO\n" |
| 1140 |
msgstr "" |
| 1141 |
"$ B<./pshm_ucase_bounce /myshm &>\n" |
| 1142 |
"[1] 270171\n" |
| 1143 |
"$ B<./pshm_ucase_send /myshm hello>\n" |
| 1144 |
"HELLO\n" |
| 1145 |
|
| 1146 |
#. type: Plain text |
| 1147 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1148 |
#, no-wrap |
| 1149 |
msgid "" |
| 1150 |
"#ifndef PSHM_UCASE_H\n" |
| 1151 |
"#define PSHM_UCASE_H\n" |
| 1152 |
"\\&\n" |
| 1153 |
"#include E<lt>semaphore.hE<gt>\n" |
| 1154 |
"#include E<lt>stddef.hE<gt>\n" |
| 1155 |
"#include E<lt>stdio.hE<gt>\n" |
| 1156 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1157 |
"\\&\n" |
| 1158 |
"#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n" |
| 1159 |
" } while (0)\n" |
| 1160 |
"\\&\n" |
| 1161 |
"#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n" |
| 1162 |
"\\&\n" |
| 1163 |
"/* Define a structure that will be imposed on the shared\n" |
| 1164 |
" memory object */\n" |
| 1165 |
"\\&\n" |
| 1166 |
"struct shmbuf {\n" |
| 1167 |
" sem_t sem1; /* POSIX unnamed semaphore */\n" |
| 1168 |
" sem_t sem2; /* POSIX unnamed semaphore */\n" |
| 1169 |
" size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n" |
| 1170 |
" char buf[BUF_SIZE]; /* Data being transferred */\n" |
| 1171 |
"};\n" |
| 1172 |
"\\&\n" |
| 1173 |
"#endif // include guard\n" |
| 1174 |
msgstr "" |
| 1175 |
"#ifndef PSHM_UCASE_H\n" |
| 1176 |
"#define PSHM_UCASE_H\n" |
| 1177 |
"\\&\n" |
| 1178 |
"#include E<lt>semaphore.hE<gt>\n" |
| 1179 |
"#include E<lt>stddef.hE<gt>\n" |
| 1180 |
"#include E<lt>stdio.hE<gt>\n" |
| 1181 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1182 |
"\\&\n" |
| 1183 |
"#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n" |
| 1184 |
" } while (0)\n" |
| 1185 |
"\\&\n" |
| 1186 |
"#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n" |
| 1187 |
"\\&\n" |
| 1188 |
"/* Define a structure that will be imposed on the shared\n" |
| 1189 |
" memory object */\n" |
| 1190 |
"\\&\n" |
| 1191 |
"struct shmbuf {\n" |
| 1192 |
" sem_t sem1; /* POSIX unnamed semaphore */\n" |
| 1193 |
" sem_t sem2; /* POSIX unnamed semaphore */\n" |
| 1194 |
" size_t cnt; /* Number of bytes used in \\[aq]buf\\[aq] */\n" |
| 1195 |
" char buf[BUF_SIZE]; /* Data being transferred */\n" |
| 1196 |
"};\n" |
| 1197 |
"\\&\n" |
| 1198 |
"#endif // include guard\n" |
| 1199 |
|
| 1200 |
#. type: Plain text |
| 1201 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1202 |
#, no-wrap |
| 1203 |
msgid "" |
| 1204 |
"/* pshm_ucase_bounce.c\n" |
| 1205 |
"\\&\n" |
| 1206 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1207 |
"*/\n" |
| 1208 |
"#include E<lt>ctype.hE<gt>\n" |
| 1209 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1210 |
"#include E<lt>stdio.hE<gt>\n" |
| 1211 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1212 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1213 |
"#include E<lt>unistd.hE<gt>\n" |
| 1214 |
"\\&\n" |
| 1215 |
"#include \"pshm_ucase.h\"\n" |
| 1216 |
"\\&\n" |
| 1217 |
"int\n" |
| 1218 |
"main(int argc, char *argv[])\n" |
| 1219 |
"{\n" |
| 1220 |
" int fd;\n" |
| 1221 |
" char *shmpath;\n" |
| 1222 |
" struct shmbuf *shmp;\n" |
| 1223 |
"\\&\n" |
| 1224 |
" if (argc != 2) {\n" |
| 1225 |
" fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n" |
| 1226 |
" exit(EXIT_FAILURE);\n" |
| 1227 |
" }\n" |
| 1228 |
"\\&\n" |
| 1229 |
" shmpath = argv[1];\n" |
| 1230 |
"\\&\n" |
| 1231 |
" /* Create shared memory object and set its size to the size\n" |
| 1232 |
" of our structure. */\n" |
| 1233 |
"\\&\n" |
| 1234 |
" fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n" |
| 1235 |
" if (fd == -1)\n" |
| 1236 |
" errExit(\"shm_open\");\n" |
| 1237 |
"\\&\n" |
| 1238 |
" if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n" |
| 1239 |
" errExit(\"ftruncate\");\n" |
| 1240 |
"\\&\n" |
| 1241 |
" /* Map the object into the caller\\[aq]s address space. */\n" |
| 1242 |
"\\&\n" |
| 1243 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1244 |
" MAP_SHARED, fd, 0);\n" |
| 1245 |
" if (shmp == MAP_FAILED)\n" |
| 1246 |
" errExit(\"mmap\");\n" |
| 1247 |
"\\&\n" |
| 1248 |
" /* Initialize semaphores as process-shared, with value 0. */\n" |
| 1249 |
"\\&\n" |
| 1250 |
" if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n" |
| 1251 |
" errExit(\"sem_init-sem1\");\n" |
| 1252 |
" if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n" |
| 1253 |
" errExit(\"sem_init-sem2\");\n" |
| 1254 |
"\\&\n" |
| 1255 |
" /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n" |
| 1256 |
" shared memory. */\n" |
| 1257 |
"\\&\n" |
| 1258 |
" if (sem_wait(&shmp-E<gt>sem1) == -1)\n" |
| 1259 |
" errExit(\"sem_wait\");\n" |
| 1260 |
"\\&\n" |
| 1261 |
" /* Convert data in shared memory into upper case. */\n" |
| 1262 |
"\\&\n" |
| 1263 |
" for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n" |
| 1264 |
" shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n" |
| 1265 |
"\\&\n" |
| 1266 |
" /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n" |
| 1267 |
" access the modified data in shared memory. */\n" |
| 1268 |
"\\&\n" |
| 1269 |
" if (sem_post(&shmp-E<gt>sem2) == -1)\n" |
| 1270 |
" errExit(\"sem_post\");\n" |
| 1271 |
"\\&\n" |
| 1272 |
" /* Unlink the shared memory object. Even if the peer process\n" |
| 1273 |
" is still using the object, this is okay. The object will\n" |
| 1274 |
" be removed only after all open references are closed. */\n" |
| 1275 |
"\\&\n" |
| 1276 |
" shm_unlink(shmpath);\n" |
| 1277 |
"\\&\n" |
| 1278 |
" exit(EXIT_SUCCESS);\n" |
| 1279 |
"}\n" |
| 1280 |
msgstr "" |
| 1281 |
"/* pshm_ucase_bounce.c\n" |
| 1282 |
"\\&\n" |
| 1283 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1284 |
"*/\n" |
| 1285 |
"#include E<lt>ctype.hE<gt>\n" |
| 1286 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1287 |
"#include E<lt>stdio.hE<gt>\n" |
| 1288 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1289 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1290 |
"#include E<lt>unistd.hE<gt>\n" |
| 1291 |
"\\&\n" |
| 1292 |
"#include \"pshm_ucase.h\"\n" |
| 1293 |
"\\&\n" |
| 1294 |
"int\n" |
| 1295 |
"main(int argc, char *argv[])\n" |
| 1296 |
"{\n" |
| 1297 |
" int fd;\n" |
| 1298 |
" char *shmpath;\n" |
| 1299 |
" struct shmbuf *shmp;\n" |
| 1300 |
"\\&\n" |
| 1301 |
" if (argc != 2) {\n" |
| 1302 |
" fprintf(stderr, \"Usage: %s /shm-path\\[rs]n\", argv[0]);\n" |
| 1303 |
" exit(EXIT_FAILURE);\n" |
| 1304 |
" }\n" |
| 1305 |
"\\&\n" |
| 1306 |
" shmpath = argv[1];\n" |
| 1307 |
"\\&\n" |
| 1308 |
" /* Create shared memory object and set its size to the size\n" |
| 1309 |
" of our structure. */\n" |
| 1310 |
"\\&\n" |
| 1311 |
" fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR, 0600);\n" |
| 1312 |
" if (fd == -1)\n" |
| 1313 |
" errExit(\"shm_open\");\n" |
| 1314 |
"\\&\n" |
| 1315 |
" if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n" |
| 1316 |
" errExit(\"ftruncate\");\n" |
| 1317 |
"\\&\n" |
| 1318 |
" /* Map the object into the caller\\[aq]s address space. */\n" |
| 1319 |
"\\&\n" |
| 1320 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1321 |
" MAP_SHARED, fd, 0);\n" |
| 1322 |
" if (shmp == MAP_FAILED)\n" |
| 1323 |
" errExit(\"mmap\");\n" |
| 1324 |
"\\&\n" |
| 1325 |
" /* Initialize semaphores as process-shared, with value 0. */\n" |
| 1326 |
"\\&\n" |
| 1327 |
" if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n" |
| 1328 |
" errExit(\"sem_init-sem1\");\n" |
| 1329 |
" if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n" |
| 1330 |
" errExit(\"sem_init-sem2\");\n" |
| 1331 |
"\\&\n" |
| 1332 |
" /* Wait for \\[aq]sem1\\[aq] to be posted by peer before touching\n" |
| 1333 |
" shared memory. */\n" |
| 1334 |
"\\&\n" |
| 1335 |
" if (sem_wait(&shmp-E<gt>sem1) == -1)\n" |
| 1336 |
" errExit(\"sem_wait\");\n" |
| 1337 |
"\\&\n" |
| 1338 |
" /* Convert data in shared memory into upper case. */\n" |
| 1339 |
"\\&\n" |
| 1340 |
" for (size_t j = 0; j E<lt> shmp-E<gt>cnt; j++)\n" |
| 1341 |
" shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n" |
| 1342 |
"\\&\n" |
| 1343 |
" /* Post \\[aq]sem2\\[aq] to tell the peer that it can now\n" |
| 1344 |
" access the modified data in shared memory. */\n" |
| 1345 |
"\\&\n" |
| 1346 |
" if (sem_post(&shmp-E<gt>sem2) == -1)\n" |
| 1347 |
" errExit(\"sem_post\");\n" |
| 1348 |
"\\&\n" |
| 1349 |
" /* Unlink the shared memory object. Even if the peer process\n" |
| 1350 |
" is still using the object, this is okay. The object will\n" |
| 1351 |
" be removed only after all open references are closed. */\n" |
| 1352 |
"\\&\n" |
| 1353 |
" shm_unlink(shmpath);\n" |
| 1354 |
"\\&\n" |
| 1355 |
" exit(EXIT_SUCCESS);\n" |
| 1356 |
"}\n" |
| 1357 |
|
| 1358 |
#. type: Plain text |
| 1359 |
#: debian-trixie |
| 1360 |
#, no-wrap |
| 1361 |
msgid "" |
| 1362 |
"/* pshm_ucase_send.c\n" |
| 1363 |
"\\&\n" |
| 1364 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1365 |
"*/\n" |
| 1366 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1367 |
"#include E<lt>stddef.hE<gt>\n" |
| 1368 |
"#include E<lt>stdio.hE<gt>\n" |
| 1369 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1370 |
"#include E<lt>string.hE<gt>\n" |
| 1371 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1372 |
"#include E<lt>unistd.hE<gt>\n" |
| 1373 |
"\\&\n" |
| 1374 |
"#include \"pshm_ucase.h\"\n" |
| 1375 |
"\\&\n" |
| 1376 |
"int\n" |
| 1377 |
"main(int argc, char *argv[])\n" |
| 1378 |
"{\n" |
| 1379 |
" int fd;\n" |
| 1380 |
" char *shmpath, *string;\n" |
| 1381 |
" size_t len;\n" |
| 1382 |
" struct shmbuf *shmp;\n" |
| 1383 |
"\\&\n" |
| 1384 |
" if (argc != 3) {\n" |
| 1385 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 1386 |
" exit(EXIT_FAILURE);\n" |
| 1387 |
" }\n" |
| 1388 |
"\\&\n" |
| 1389 |
" shmpath = argv[1];\n" |
| 1390 |
" string = argv[2];\n" |
| 1391 |
" len = strlen(string);\n" |
| 1392 |
"\\&\n" |
| 1393 |
" if (len E<gt> BUF_SIZE) {\n" |
| 1394 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 1395 |
" exit(EXIT_FAILURE);\n" |
| 1396 |
" }\n" |
| 1397 |
"\\&\n" |
| 1398 |
" /* Open the existing shared memory object and map it\n" |
| 1399 |
" into the caller\\[aq]s address space. */\n" |
| 1400 |
"\\&\n" |
| 1401 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 1402 |
" if (fd == -1)\n" |
| 1403 |
" errExit(\"shm_open\");\n" |
| 1404 |
"\\&\n" |
| 1405 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1406 |
" MAP_SHARED, fd, 0);\n" |
| 1407 |
" if (shmp == MAP_FAILED)\n" |
| 1408 |
" errExit(\"mmap\");\n" |
| 1409 |
"\\&\n" |
| 1410 |
" /* Copy data into the shared memory object. */\n" |
| 1411 |
"\\&\n" |
| 1412 |
" shmp-E<gt>cnt = len;\n" |
| 1413 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1414 |
"\\&\n" |
| 1415 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1416 |
"\\&\n" |
| 1417 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1418 |
" errExit(\"sem_post\");\n" |
| 1419 |
"\\&\n" |
| 1420 |
" /* Wait until peer says that it has finished accessing\n" |
| 1421 |
" the shared memory. */\n" |
| 1422 |
"\\&\n" |
| 1423 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1424 |
" errExit(\"sem_wait\");\n" |
| 1425 |
"\\&\n" |
| 1426 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1427 |
"\\&\n" |
| 1428 |
" write(STDOUT_FILENO, &shmp-E<gt>buf, len);\n" |
| 1429 |
" write(STDOUT_FILENO, \"\\[rs]n\", 1);\n" |
| 1430 |
"\\&\n" |
| 1431 |
" exit(EXIT_SUCCESS);\n" |
| 1432 |
"}\n" |
| 1433 |
msgstr "" |
| 1434 |
"/* pshm_ucase_send.c\n" |
| 1435 |
"\\&\n" |
| 1436 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1437 |
"*/\n" |
| 1438 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1439 |
"#include E<lt>stddef.hE<gt>\n" |
| 1440 |
"#include E<lt>stdio.hE<gt>\n" |
| 1441 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1442 |
"#include E<lt>string.hE<gt>\n" |
| 1443 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1444 |
"#include E<lt>unistd.hE<gt>\n" |
| 1445 |
"\\&\n" |
| 1446 |
"#include \"pshm_ucase.h\"\n" |
| 1447 |
"\\&\n" |
| 1448 |
"int\n" |
| 1449 |
"main(int argc, char *argv[])\n" |
| 1450 |
"{\n" |
| 1451 |
" int fd;\n" |
| 1452 |
" char *shmpath, *string;\n" |
| 1453 |
" size_t len;\n" |
| 1454 |
" struct shmbuf *shmp;\n" |
| 1455 |
"\\&\n" |
| 1456 |
" if (argc != 3) {\n" |
| 1457 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 1458 |
" exit(EXIT_FAILURE);\n" |
| 1459 |
" }\n" |
| 1460 |
"\\&\n" |
| 1461 |
" shmpath = argv[1];\n" |
| 1462 |
" string = argv[2];\n" |
| 1463 |
" len = strlen(string);\n" |
| 1464 |
"\\&\n" |
| 1465 |
" if (len E<gt> BUF_SIZE) {\n" |
| 1466 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 1467 |
" exit(EXIT_FAILURE);\n" |
| 1468 |
" }\n" |
| 1469 |
"\\&\n" |
| 1470 |
" /* Open the existing shared memory object and map it\n" |
| 1471 |
" into the caller\\[aq]s address space. */\n" |
| 1472 |
"\\&\n" |
| 1473 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 1474 |
" if (fd == -1)\n" |
| 1475 |
" errExit(\"shm_open\");\n" |
| 1476 |
"\\&\n" |
| 1477 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1478 |
" MAP_SHARED, fd, 0);\n" |
| 1479 |
" if (shmp == MAP_FAILED)\n" |
| 1480 |
" errExit(\"mmap\");\n" |
| 1481 |
"\\&\n" |
| 1482 |
" /* Copy data into the shared memory object. */\n" |
| 1483 |
"\\&\n" |
| 1484 |
" shmp-E<gt>cnt = len;\n" |
| 1485 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1486 |
"\\&\n" |
| 1487 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1488 |
"\\&\n" |
| 1489 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1490 |
" errExit(\"sem_post\");\n" |
| 1491 |
"\\&\n" |
| 1492 |
" /* Wait until peer says that it has finished accessing\n" |
| 1493 |
" the shared memory. */\n" |
| 1494 |
"\\&\n" |
| 1495 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1496 |
" errExit(\"sem_wait\");\n" |
| 1497 |
"\\&\n" |
| 1498 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1499 |
"\\&\n" |
| 1500 |
" write(STDOUT_FILENO, &shmp-E<gt>buf, len);\n" |
| 1501 |
" write(STDOUT_FILENO, \"\\[rs]n\", 1);\n" |
| 1502 |
"\\&\n" |
| 1503 |
" exit(EXIT_SUCCESS);\n" |
| 1504 |
"}\n" |
| 1505 |
|
| 1506 |
#. type: TH |
| 1507 |
#: fedora-44 fedora-rawhide |
| 1508 |
#, no-wrap |
| 1509 |
msgid "2024-07-23" |
| 1510 |
msgstr "23 يوليو 2024" |
| 1511 |
|
| 1512 |
#. type: TH |
| 1513 |
#: fedora-44 fedora-rawhide |
| 1514 |
#, no-wrap |
| 1515 |
msgid "Linux man-pages 6.13" |
| 1516 |
msgstr "صفحات دليل لينكس 6.13" |
| 1517 |
|
| 1518 |
#. type: Plain text |
| 1519 |
#: fedora-44 fedora-rawhide |
| 1520 |
#, no-wrap |
| 1521 |
msgid "" |
| 1522 |
"/* pshm_ucase_send.c\n" |
| 1523 |
"\\&\n" |
| 1524 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1525 |
"*/\n" |
| 1526 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1527 |
"#include E<lt>stddef.hE<gt>\n" |
| 1528 |
"#include E<lt>stdio.hE<gt>\n" |
| 1529 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1530 |
"#include E<lt>string.hE<gt>\n" |
| 1531 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1532 |
"#include E<lt>unistd.hE<gt>\n" |
| 1533 |
"\\&\n" |
| 1534 |
"#include \"pshm_ucase.h\"\n" |
| 1535 |
"\\&\n" |
| 1536 |
"int\n" |
| 1537 |
"main(int argc, char *argv[])\n" |
| 1538 |
"{\n" |
| 1539 |
" int fd;\n" |
| 1540 |
" char *shmpath, *string;\n" |
| 1541 |
" size_t len;\n" |
| 1542 |
" struct shmbuf *shmp;\n" |
| 1543 |
"\\&\n" |
| 1544 |
" if (argc != 3) {\n" |
| 1545 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 1546 |
" exit(EXIT_FAILURE);\n" |
| 1547 |
" }\n" |
| 1548 |
"\\&\n" |
| 1549 |
" shmpath = argv[1];\n" |
| 1550 |
" string = argv[2];\n" |
| 1551 |
" len = strlen(string);\n" |
| 1552 |
"\\&\n" |
| 1553 |
" if (len E<gt> BUF_SIZE) {\n" |
| 1554 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 1555 |
" exit(EXIT_FAILURE);\n" |
| 1556 |
" }\n" |
| 1557 |
"\\&\n" |
| 1558 |
" /* Open the existing shared memory object and map it\n" |
| 1559 |
" into the caller\\[aq]s address space. */\n" |
| 1560 |
"\\&\n" |
| 1561 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 1562 |
" if (fd == -1)\n" |
| 1563 |
" errExit(\"shm_open\");\n" |
| 1564 |
"\\&\n" |
| 1565 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1566 |
" MAP_SHARED, fd, 0);\n" |
| 1567 |
" if (shmp == MAP_FAILED)\n" |
| 1568 |
" errExit(\"mmap\");\n" |
| 1569 |
"\\&\n" |
| 1570 |
" /* Copy data into the shared memory object. */\n" |
| 1571 |
"\\&\n" |
| 1572 |
" shmp-E<gt>cnt = len;\n" |
| 1573 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1574 |
"\\&\n" |
| 1575 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1576 |
"\\&\n" |
| 1577 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1578 |
" errExit(\"sem_post\");\n" |
| 1579 |
"\\&\n" |
| 1580 |
" /* Wait until peer says that it has finished accessing\n" |
| 1581 |
" the shared memory. */\n" |
| 1582 |
"\\&\n" |
| 1583 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1584 |
" errExit(\"sem_wait\");\n" |
| 1585 |
"\\&\n" |
| 1586 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1587 |
"\\&\n" |
| 1588 |
" if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n" |
| 1589 |
" errExit(\"write\");\n" |
| 1590 |
" if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n" |
| 1591 |
" errExit(\"write\");\n" |
| 1592 |
"\\&\n" |
| 1593 |
" exit(EXIT_SUCCESS);\n" |
| 1594 |
"}\n" |
| 1595 |
msgstr "" |
| 1596 |
"/* pshm_ucase_send.c\n" |
| 1597 |
"\\&\n" |
| 1598 |
" Licensed under GNU General Public License v2 or later.\n" |
| 1599 |
"*/\n" |
| 1600 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1601 |
"#include E<lt>stddef.hE<gt>\n" |
| 1602 |
"#include E<lt>stdio.hE<gt>\n" |
| 1603 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1604 |
"#include E<lt>string.hE<gt>\n" |
| 1605 |
"#include E<lt>sys/mman.hE<gt>\n" |
| 1606 |
"#include E<lt>unistd.hE<gt>\n" |
| 1607 |
"\\&\n" |
| 1608 |
"#include \"pshm_ucase.h\"\n" |
| 1609 |
"\\&\n" |
| 1610 |
"int\n" |
| 1611 |
"main(int argc, char *argv[])\n" |
| 1612 |
"{\n" |
| 1613 |
" int fd;\n" |
| 1614 |
" char *shmpath, *string;\n" |
| 1615 |
" size_t len;\n" |
| 1616 |
" struct shmbuf *shmp;\n" |
| 1617 |
"\\&\n" |
| 1618 |
" if (argc != 3) {\n" |
| 1619 |
" fprintf(stderr, \"Usage: %s /shm-path string\\[rs]n\", argv[0]);\n" |
| 1620 |
" exit(EXIT_FAILURE);\n" |
| 1621 |
" }\n" |
| 1622 |
"\\&\n" |
| 1623 |
" shmpath = argv[1];\n" |
| 1624 |
" string = argv[2];\n" |
| 1625 |
" len = strlen(string);\n" |
| 1626 |
"\\&\n" |
| 1627 |
" if (len E<gt> BUF_SIZE) {\n" |
| 1628 |
" fprintf(stderr, \"String is too long\\[rs]n\");\n" |
| 1629 |
" exit(EXIT_FAILURE);\n" |
| 1630 |
" }\n" |
| 1631 |
"\\&\n" |
| 1632 |
" /* Open the existing shared memory object and map it\n" |
| 1633 |
" into the caller\\[aq]s address space. */\n" |
| 1634 |
"\\&\n" |
| 1635 |
" fd = shm_open(shmpath, O_RDWR, 0);\n" |
| 1636 |
" if (fd == -1)\n" |
| 1637 |
" errExit(\"shm_open\");\n" |
| 1638 |
"\\&\n" |
| 1639 |
" shmp = mmap(NULL, sizeof(*shmp), PROT_READ | PROT_WRITE,\n" |
| 1640 |
" MAP_SHARED, fd, 0);\n" |
| 1641 |
" if (shmp == MAP_FAILED)\n" |
| 1642 |
" errExit(\"mmap\");\n" |
| 1643 |
"\\&\n" |
| 1644 |
" /* Copy data into the shared memory object. */\n" |
| 1645 |
"\\&\n" |
| 1646 |
" shmp-E<gt>cnt = len;\n" |
| 1647 |
" memcpy(&shmp-E<gt>buf, string, len);\n" |
| 1648 |
"\\&\n" |
| 1649 |
" /* Tell peer that it can now access shared memory. */\n" |
| 1650 |
"\\&\n" |
| 1651 |
" if (sem_post(&shmp-E<gt>sem1) == -1)\n" |
| 1652 |
" errExit(\"sem_post\");\n" |
| 1653 |
"\\&\n" |
| 1654 |
" /* Wait until peer says that it has finished accessing\n" |
| 1655 |
" the shared memory. */\n" |
| 1656 |
"\\&\n" |
| 1657 |
" if (sem_wait(&shmp-E<gt>sem2) == -1)\n" |
| 1658 |
" errExit(\"sem_wait\");\n" |
| 1659 |
"\\&\n" |
| 1660 |
" /* Write modified data in shared memory to standard output. */\n" |
| 1661 |
"\\&\n" |
| 1662 |
" if (write(STDOUT_FILENO, &shmp-E<gt>buf, len) == -1)\n" |
| 1663 |
" errExit(\"write\");\n" |
| 1664 |
" if (write(STDOUT_FILENO, \"\\[rs]n\", 1) == -1)\n" |
| 1665 |
" errExit(\"write\");\n" |
| 1666 |
"\\&\n" |
| 1667 |
" exit(EXIT_SUCCESS);\n" |
| 1668 |
"}\n" |
| 1669 |
|
| 1670 |
#. type: TH |
| 1671 |
#: mageia-cauldron |
| 1672 |
#, no-wrap |
| 1673 |
msgid "Linux man-pages 6.17" |
| 1674 |
msgstr "صفحات دليل لينكس 6.17" |
| 1675 |
|
| 1676 |
#. type: TH |
| 1677 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 1678 |
#, no-wrap |
| 1679 |
msgid "Linux man-pages (unreleased)" |
| 1680 |
msgstr "صفحات دليل لينكس (لم تصدر بعد)" |