Debian Codegraph @

po/de/man2/shmop.2.po

raw
1 # German translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Ralf Demmer <[email protected]>
5 # Chris Leick <[email protected]>, 2010-2014.
6 # Helge Kreutzmann <[email protected]>, 2020, 2021, 2025.
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: manpages-l10n 4.28.0\n"
10 "POT-Creation-Date: 2026-06-05 06:43+0200\n"
11 "PO-Revision-Date: 2026-05-29 20:48+0200\n"
12 "Last-Translator: Helge Kreutzmann <[email protected]>\n"
13 "Language-Team: German <[email protected]>\n"
14 "Language: de\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=(n != 1);\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 "SHMOP"
25 msgstr "SHMOP"
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. Februar 2026"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Linux man-pages 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 "BEZEICHNUNG"
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 "shmat, shmdt - System V shared memory operations"
51 msgstr "shmat, shmdt - System-V-Operationen mit gemeinsam benutztem Speicher"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "LIBRARY"
58 msgstr "BIBLIOTHEK"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "Standard C library (I<libc>,\\ I<-lc>)"
64 msgstr "Standard-C-Bibliothek (I<libc>,\\ I<-lc>)"
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 "SYNOPSIS"
71 msgstr "ÜBERSICHT"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>sys/shm.hE<gt>>\n"
78 msgstr "B<#include E<lt>sys/shm.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid ""
85 "B<void *shmat(int >I<shmid>B<, const void *_Nullable >I<shmaddr>B<, int >I<shmflg>B<);>\n"
86 "B<int shmdt(const void *>I<shmaddr>B<);>\n"
87 msgstr ""
88 "B<void *shmat(int >I<shmid>B<, const void *_Nullable >I<shmaddr>B<, int >I<shmflg>B<);>\n"
89 "B<int shmdt(const void *>I<shmaddr>B<);>\n"
90
91 #. type: SH
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid "DESCRIPTION"
96 msgstr "BESCHREIBUNG"
97
98 #. type: SS
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid "shmat()"
103 msgstr "shmat()"
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<shmat>() attaches the System\\ V shared memory segment identified by "
110 "I<shmid> to the address space of the calling process. The attaching address "
111 "is specified by I<shmaddr> with one of the following criteria:"
112 msgstr ""
113 "B<shmat>() blendet das durch I<shmid> bezeichnete gemeinsame System-V-"
114 "Speichersegment in den Adressraum des aufrufenden Prozesses ein. Die Adresse "
115 "der Einblendung wird durch I<shmaddr> nach einem der folgenden Kriterien "
116 "bestimmt:"
117
118 #. type: IP
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 #, no-wrap
122 msgid "\\[bu]"
123 msgstr "\\[bu]"
124
125 #. type: Plain text
126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
128 msgid ""
129 "If I<shmaddr> is NULL, the system chooses a suitable (unused) page-aligned "
130 "address to attach the segment."
131 msgstr ""
132 "Falls I<shmaddr> NULL ist, wählt das System eine geeignete (freie), an einer "
133 "Speicherseite ausgerichtete Adresse, um das Segment einzublenden."
134
135 #. type: Plain text
136 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
137 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
138 msgid ""
139 "If I<shmaddr> isn't NULL and B<SHM_RND> is specified in I<shmflg>, the "
140 "attach occurs at the address equal to I<shmaddr> rounded down to the nearest "
141 "multiple of B<SHMLBA>."
142 msgstr ""
143 "Wenn I<shmaddr> nicht NULL ist und B<SHM_RND> in I<shmflg> angegeben wurde, "
144 "wird die Adresse durch Abrundung von I<shmaddr> bis auf ein Vielfaches von "
145 "B<SHMLBA> bestimmt."
146
147 #. type: Plain text
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 msgid ""
151 "Otherwise, I<shmaddr> must be a page-aligned address at which the attach "
152 "occurs."
153 msgstr ""
154 "Andernfalls muss I<shmaddr> eine an einer Speicherseite ausgerichtete "
155 "Adresse sein, an welcher das Einblenden beginnt."
156
157 #. type: Plain text
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 msgid ""
161 "In addition to B<SHM_RND>, the following flags may be specified in the "
162 "I<shmflg> bit-mask argument:"
163 msgstr ""
164 "Zusätzlich zu B<SHM_RND> dürfen die folgenden Schalter im Bitmask-Argument "
165 "von I<shmflg> angegeben werden:"
166
167 #. type: TP
168 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
169 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
170 #, no-wrap
171 msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
172 msgstr "B<SHM_EXEC> (Linux-spezifisch; seit Linux 2.6.9)"
173
174 #. type: Plain text
175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
177 msgid ""
178 "Allow the contents of the segment to be executed. The caller must have "
179 "execute permission on the segment."
180 msgstr ""
181 "ermöglicht, dass der Inhalt des Segments ausgeführt wird. Der Aufrufende "
182 "muss auf dem Segment Ausführungsrechte besitzen."
183
184 #. type: TP
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 #, no-wrap
188 msgid "B<SHM_RDONLY>"
189 msgstr "B<SHM_RDONLY>"
190
191 #. type: Plain text
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 msgid ""
195 "Attach the segment for read-only access. The process must have read "
196 "permission for the segment. If this flag is not specified, the segment is "
197 "attached for read and write access, and the process must have read and write "
198 "permission for the segment. There is no notion of a write-only shared "
199 "memory segment."
200 msgstr ""
201 "blendet das Segment mit Lesezugriff ein. Der Prozess muss die Berechtigung "
202 "für Lesezugriffe auf das Segment besitzen. Falls dieser Schalter nicht "
203 "angegeben ist, wird das Segment mit Lese- und Schreibzugriff eingeblendet "
204 "und der Prozess muss die Berechtigung für Lese- und Schreibzugriffe auf das "
205 "Segment besitzen. Ein gemeinsames Speichersegment mit reinem Schreibzugriff "
206 "ist nicht vorgesehen."
207
208 #. type: TP
209 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
210 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
211 #, no-wrap
212 msgid "B<SHM_REMAP> (Linux-specific)"
213 msgstr "B<SHM_REMAP> (Linux-spezifisch)"
214
215 #. type: Plain text
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 msgid ""
219 "This flag specifies that the mapping of the segment should replace any "
220 "existing mapping in the range starting at I<shmaddr> and continuing for the "
221 "size of the segment. (Normally, an B<EINVAL> error would result if a "
222 "mapping already exists in this address range.) In this case, I<shmaddr> "
223 "must not be NULL."
224 msgstr ""
225 "Dieser Schalter gibt an, dass das Abbilden des Segments jedes existierende "
226 "Abbilden im Bereich von I<shmaddr> bis zur Größe des Segments ersetzen soll. "
227 "(Falls bereits eine Abbildung in diesem Adressbereich existiert, würde dies "
228 "normalerweise zu dem Fehler B<EINVAL> führen.) In diesem Fall darf "
229 "I<shmaddr> nicht NULL sein."
230
231 #. type: Plain text
232 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
233 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
234 msgid ""
235 "The B<brk>(2) value of the calling process is not altered by the attach. "
236 "The segment will automatically be detached at process exit. The same "
237 "segment may be attached as a read and as a read-write one, and more than "
238 "once, in the process's address space."
239 msgstr ""
240 "Der B<brk>(2)-Wert des aufrufenden Prozesses wird durch das Einblenden nicht "
241 "verändert. Das Segment wird bei Beenden des Prozesses automatisch "
242 "abgetrennt. Das gleiche Segment kann mit Lese- sowie mit Lese- und "
243 "Schreibzugriff einmal oder mehrfach in den Adressraum des Prozesses "
244 "eingeblendet werden."
245
246 #. type: Plain text
247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
249 msgid ""
250 "A successful B<shmat>() call updates the members of the I<shmid_ds> "
251 "structure (see B<shmctl>(2)) associated with the shared memory segment as "
252 "follows:"
253 msgstr ""
254 "Nach einem erfolgreichen B<shmat>()-Aufruf aktualisiert das System die "
255 "Bestandteile der dem Speichersegment zugeordneten I<shmid_ds>-Struktur "
256 "(siehe B<shmctl>(2)) wie folgt:"
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 "I<shm_atime> is set to the current time."
262 msgstr "I<shm_atime> wird auf die aktuelle Zeit gesetzt."
263
264 #. type: Plain text
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 msgid "I<shm_lpid> is set to the process-ID of the calling process."
268 msgstr ""
269 "I<shm_lpid> wird auf die Prozesskennung des aufrufenden Prozesses gesetzt."
270
271 #. type: Plain text
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 msgid "I<shm_nattch> is incremented by one."
275 msgstr "I<shm_nattch> wird um Eins erhöht."
276
277 #. type: SS
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 #, no-wrap
281 msgid "shmdt()"
282 msgstr "shmdt()"
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 "B<shmdt>() detaches the shared memory segment located at the address "
289 "specified by I<shmaddr> from the address space of the calling process. The "
290 "to-be-detached segment must be currently attached with I<shmaddr> equal to "
291 "the value returned by the attaching B<shmat>() call."
292 msgstr ""
293 "B<shmdt>() löst das gemeinsame Speichersegment, das an der Adresse "
294 "I<shmaddr> liegt, aus dem Adressraum des aufrufenden Prozesses. Das zu "
295 "entfernende gemeinsame Speichersegment muss momentan mit I<shmaddr> "
296 "eingeblendet sein, das dem Rückgabewert des einbendenden B<shat>()-Aufrufs "
297 "entspricht."
298
299 #. type: Plain text
300 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
301 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
302 msgid ""
303 "On a successful B<shmdt>() call, the system updates the members of the "
304 "I<shmid_ds> structure associated with the shared memory segment as follows:"
305 msgstr ""
306 "Nach einem erfolgreichen B<shmdt>()-Aufruf aktualisiert das System die "
307 "Bestandteile der dem Speichersegment zugeordneten Struktur B<shmid_ds> wie "
308 "folgt:"
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 "I<shm_dtime> is set to the current time."
314 msgstr "I<shm_dtime> wird auf die aktuelle Zeit gesetzt."
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 "I<shm_nattch> is decremented by one. If it becomes 0 and the segment is "
321 "marked for deletion, the segment is deleted."
322 msgstr ""
323 "I<shm_nattch> wird um Eins verringert. Wenn es dabei zu 0 wird und das "
324 "Segment zum Löschen markiert ist, wird es gelöscht."
325
326 #. type: SH
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 #, no-wrap
330 msgid "RETURN VALUE"
331 msgstr "RÜCKGABEWERT"
332
333 #. type: Plain text
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 msgid ""
337 "On success, B<shmat>() returns the address of the attached shared memory "
338 "segment; on error, I<(void\\ *)\\ -1> is returned, and I<errno> is set to "
339 "indicate the error."
340 msgstr ""
341 "Bei Erfolg gibt B<shmat>() die Adresse des eingeblendeten gemeinsamen "
342 "Speichersegments zurück; bei einem Fehler wird I<(void\\ *)\\ -1> "
343 "zurückgegeben und I<errno> gesetzt, um den Fehlers anzuzeigen."
344
345 #. type: Plain text
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 msgid ""
349 "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> is "
350 "set to indicate the error."
351 msgstr ""
352 "Bei Erfolg gibt B<shmdt>() 0 zurück; bei einem Fehler wird -1 zurückgegeben "
353 "und I<errno> gesetzt, um den Fehlers anzuzeigen."
354
355 #. type: SH
356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
358 #, no-wrap
359 msgid "ERRORS"
360 msgstr "FEHLER"
361
362 #. type: Plain text
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 msgid "B<shmat>() can fail with one of the following errors:"
366 msgstr "B<shmat>() kann mit einem der folgenden Fehler fehlschlagen:"
367
368 #. type: TP
369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
371 #, no-wrap
372 msgid "B<EACCES>"
373 msgstr "B<EACCES>"
374
375 #. type: Plain text
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 msgid ""
379 "The calling process does not have the required permissions for the requested "
380 "attach type, and does not have the B<CAP_IPC_OWNER> capability in the user "
381 "namespace that governs its IPC namespace."
382 msgstr ""
383 "Dem aufrufenden Prozess fehlen die nötigen Zugriffsrechte für den "
384 "angeforderten Einblendetyp und die B<CAP_IPC_OWNER>-Capability in dem "
385 "Benutzernamensraum, der seinen IPC-Namensraum beherrscht."
386
387 #. type: TP
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "B<EIDRM>"
392 msgstr "B<EIDRM>"
393
394 #. type: Plain text
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 msgid "I<shmid> points to a removed identifier."
398 msgstr "I<shmid> zeigt auf einen entfernten Bezeichner."
399
400 #. type: TP
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 #, no-wrap
404 msgid "B<EINVAL>"
405 msgstr "B<EINVAL>"
406
407 #. type: Plain text
408 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
409 #: opensuse-tumbleweed
410 msgid ""
411 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
412 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
413 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
414 msgstr ""
415 "Ungültiger I<shmid>-Wert, nicht ausgerichteter (d.h. nicht an die "
416 "Seitengröße angepasst und B<SHM_RND> wurde nicht angegeben) oder ungültiger "
417 "I<shmaddr>-Wert oder es wurde B<SHM_REMAP> angegeben und I<shmaddr> war NULL."
418
419 #. type: TP
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "B<ENOMEM>"
424 msgstr "B<ENOMEM>"
425
426 #. type: Plain text
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 msgid "Could not allocate memory for the descriptor or for the page tables."
430 msgstr ""
431 "Es konnte kein Speicher für den Deskriptor oder die Seitentabellen "
432 "reserviert werden."
433
434 #. type: Plain text
435 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
436 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
437 msgid "B<shmdt>() can fail with one of the following errors:"
438 msgstr "B<shmdt>() kann mit einem der folgenden Fehler fehlschlagen:"
439
440 #. The following since Linux 2.6.17-rc1:
441 #. type: Plain text
442 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
443 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
444 msgid ""
445 "There is no shared memory segment attached at I<shmaddr>; or, I<shmaddr> is "
446 "not aligned on a page boundary."
447 msgstr ""
448 "Es ist kein gemeinsames Speichersegment in I<shmaddr> eingeblendet oder "
449 "I<shmaddr> ist nicht an der Seitengrenze ausgerichtet."
450
451 #. type: SH
452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
454 #, no-wrap
455 msgid "STANDARDS"
456 msgstr "STANDARDS"
457
458 #. type: Plain text
459 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
460 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
461 msgid "POSIX.1-2008."
462 msgstr "POSIX.1-2008."
463
464 #. type: SH
465 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
466 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
467 #, no-wrap
468 msgid "HISTORY"
469 msgstr "GESCHICHTE"
470
471 #. SVr4 documents an additional error condition EMFILE.
472 #. type: Plain text
473 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
474 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
475 msgid "POSIX.1-2001, SVr4."
476 msgstr "POSIX.1-2001, SVr4."
477
478 #. type: Plain text
479 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
480 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
481 msgid ""
482 "In SVID 3 (or perhaps earlier), the type of the I<shmaddr> argument was "
483 "changed from I<char\\ *> into I<const void\\ *>, and the returned type of "
484 "B<shmat>() from I<char\\ *> into I<void\\ *>."
485 msgstr ""
486 "In SVID 3 (oder vielleicht früher) wurde der Typ des Arguments I<shmaddr> "
487 "von I<char\\ *> in I<const void\\ *> und der von B<shmat>() zurückgegebene "
488 "Typ von I<char\\ *> in I<void\\ *> geändert."
489
490 #. type: Plain text
491 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
492 #: opensuse-tumbleweed
493 msgid ""
494 "POSIX.1-2024 changed the error code from I<(void\\ *)\\ -1> to B<SHM_FAILED>."
495 msgstr ""
496 "POSIX.1-2024 änderte den Fehlercode von I<(void\\ *)\\ -1> auf B<SHM_FAILED>."
497
498 #. type: SH
499 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
500 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
501 #, no-wrap
502 msgid "NOTES"
503 msgstr "ANMERKUNGEN"
504
505 #. type: Plain text
506 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
507 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
508 msgid ""
509 "After a B<fork>(2), the child inherits the attached shared memory segments."
510 msgstr ""
511 "Nach einem B<fork>(2) erbt der Kindprozess das eingeblendete gemeinsame "
512 "Speichersegment."
513
514 #. type: Plain text
515 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
516 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
517 msgid ""
518 "After an B<execve>(2), all attached shared memory segments are detached from "
519 "the process."
520 msgstr ""
521 "Nach einem B<exec>(2) sind alle eingeblendeten gemeinsamen Speichersegmente "
522 "vom Prozess abgelöst."
523
524 #. type: Plain text
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 msgid ""
528 "Upon B<_exit>(2), all attached shared memory segments are detached from the "
529 "process."
530 msgstr ""
531 "Bei einem B<exit>(2) sind alle eingeblendeten gemeinsamen Speichersegmente "
532 "vom Prozess abgelöst."
533
534 #. type: Plain text
535 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
536 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
537 msgid ""
538 "Using B<shmat>() with I<shmaddr> equal to NULL is the preferred, portable "
539 "way of attaching a shared memory segment. Be aware that the shared memory "
540 "segment attached in this way may be attached at different addresses in "
541 "different processes. Therefore, any pointers maintained within the shared "
542 "memory must be made relative (typically to the starting address of the "
543 "segment), rather than absolute."
544 msgstr ""
545 "Die bevorzugte, portierbare Möglichkeit, ein gemeinsames Speichersegment "
546 "einzublenden, besteht darin, B<shmat>() mit I<shmaddr> gleich NULL zu "
547 "benutzen. Sie sollten wissen, dass das eingeblendete gemeinsame "
548 "Speichersegment auf diese Art an unterschiedliche Adressen in "
549 "unterschiedlichen Prozessen eingeblendet werden kann. Deshalb müssen alle "
550 "innerhalb des gemeinsamen Speichers verwalteten Zeiger relativ "
551 "(typischerweise zur Startadresse des Segments) statt absolut sein."
552
553 #. type: Plain text
554 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
555 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
556 msgid ""
557 "On Linux, it is possible to attach a shared memory segment even if it is "
558 "already marked to be deleted. However, POSIX.1 does not specify this "
559 "behavior and many other implementations do not support it."
560 msgstr ""
561 "Unter Linux ist es möglich, sogar ein gemeinsames Speichersegment "
562 "einzublenden, wenn es bereits zum Löschen markiert ist. POSIX.1 spezifiziert "
563 "dieses Verhalten jedoch nicht und andere Implementierungen unterstützen es "
564 "nicht."
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 "The following system parameter affects B<shmat>():"
570 msgstr "Der folgende Systemparameter beeinflusst B<shmat>():"
571
572 #. type: TP
573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
575 #, no-wrap
576 msgid "B<SHMLBA>"
577 msgstr "B<SHMLBA>"
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 ""
583 "Segment low boundary address multiple. When explicitly specifying an attach "
584 "address in a call to B<shmat>(), the caller should ensure that the address "
585 "is a multiple of this value. This is necessary on some architectures, in "
586 "order either to ensure good CPU cache performance or to ensure that "
587 "different attaches of the same segment have consistent views within the CPU "
588 "cache. B<SHMLBA> is normally some multiple of the system page size. (On "
589 "many Linux architectures, B<SHMLBA> is the same as the system page size.)"
590 msgstr ""
591 "Untere Segmentgrenze des Adressvielfachen. Wenn in einem Aufruf von "
592 "B<shmat>() eine Adresse explizit angegeben wurde. sollte der Aufrufende "
593 "sicherstellen, dass die Adresse ein Vielfaches dieses Wertes ist. Dies ist "
594 "auf einigen Architekturen notwendig, um eine gute Leistung des CPU-"
595 "Zwischenspeichers zu gewährleisten oder um sicherzustellen, dass "
596 "unterschiedliche Einblendungen desselben Segments konsistente Ansichten "
597 "innerhalb des CPU-Zwischenspeichers haben. B<SHMLBA> ist normalerweise "
598 "irgendein Vielfaches von der Seitengröße des Systems. (Auf vielen Linux-"
599 "Architekturen ist B<SHMLBA> dasselbe wie die Seitengröße des Systems.)"
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 implementation places no intrinsic per-process limit on the number of "
606 "shared memory segments (B<SHMSEG>)."
607 msgstr ""
608 "Die Implementierung hat keine inhärenten pro-Prozess-Einschränkungen "
609 "bezüglich der maximalen Anzahl von gemeinsamen Speichersegmenten (B<SHMSEG>)."
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 "EXAMPLES"
616 msgstr "BEISPIELE"
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 ""
622 "The two programs shown below exchange a string using a shared memory "
623 "segment. Further details about the programs are given below. First, we "
624 "show a shell session demonstrating their use."
625 msgstr ""
626 "Die zwei nachfolgend aufgeführten Programme tauschen eine Zeichenkette über "
627 "ein gemeinsames Speichersegment aus. Weitere Details über die Programme "
628 "finden Sie nachfolgend. Zuerst wird eine Shell-Sitzung gezeigt, die ihre "
629 "Verwendung zeigt."
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 ""
635 "In one terminal window, we run the \"reader\" program, which creates a "
636 "System V shared memory segment and a System V semaphore set. The program "
637 "prints out the IDs of the created objects, and then waits for the semaphore "
638 "to change value."
639 msgstr ""
640 "In einem Terminalfenster führen wir das »Lese«-Programm aus, das ein "
641 "gemeinsam benutztes Speichersegment und eine Semaphoren-Gruppe gemäß System-"
642 "V erstellt. Das Programm gibt die Kennung der erstellten Objekte aus und "
643 "wartet dann darauf, dass die Semaphore ihren Wert ändern."
644
645 #. type: Plain text
646 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
647 #: opensuse-tumbleweed
648 #, no-wrap
649 msgid ""
650 "$B< ./svshm_string_read>;\n"
651 "shmid = 1114194\n"
652 "semid = 15\n"
653 msgstr ""
654 "$B< ./svshm_string_read>;\n"
655 "shmid = 1114194\n"
656 "semid = 15\n"
657
658 #. type: Plain text
659 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
660 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
661 msgid ""
662 "In another terminal window, we run the \"writer\" program. The \"writer\" "
663 "program takes three command-line arguments: the IDs of the shared memory "
664 "segment and semaphore set created by the \"reader\", and a string. It "
665 "attaches the existing shared memory segment, copies the string to the shared "
666 "memory, and modifies the semaphore value."
667 msgstr ""
668 "In einem anderen Terminal-Fenster führen wir das »Schreibe«-Programm aus\\&. "
669 "Das »Schreibe«-Programm akzeptiert drei Befehlszeilenargumente: die "
670 "Kennungen des vom »Lese«-Programm erstellten gemeinsam benutzten "
671 "Speichersegments und die erstellte Semaphoren-Gruppe und eine Zeichenkette. "
672 "Es blendet das bestehende gemeinsam benutzte Speichersegment ein, kopiert "
673 "die Zeichenkette in den gemeinsam benutzten Speicher und verändert den Wert "
674 "der Semaphore."
675
676 #. type: Plain text
677 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
678 #: opensuse-tumbleweed
679 #, no-wrap
680 msgid "$B< ./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>;\n"
681 msgstr "$B< ./svshm_string_write 1114194 15 \\[aq]Hallo, Welt\\[aq]>;\n"
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 ""
687 "Returning to the terminal where the \"reader\" is running, we see that the "
688 "program has ceased waiting on the semaphore and has printed the string that "
689 "was copied into the shared memory segment by the writer:"
690 msgstr ""
691 "In dem Terminal-Fenster, in dem das »Lese«-Programm läuft, können wir sehen, "
692 "dass das Programm aufgehört hat, auf die Semaphore zu warten und die "
693 "Zeichenkette ausgegeben hat, die vom Schreibe-Programm in den gemeinsam "
694 "benutzten Speicher kopiert wurde:"
695
696 #. type: Plain text
697 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
698 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
699 #, no-wrap
700 msgid "Hello, world\n"
701 msgstr "Hallo Welt\n"
702
703 #. type: SS
704 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
705 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
706 #, no-wrap
707 msgid "Program source: svshm_string.h"
708 msgstr "Quelle des Programms: svshm_string.h"
709
710 #. type: Plain text
711 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
712 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
713 msgid ""
714 "The following header file is included by the \"reader\" and \"writer\" "
715 "programs:"
716 msgstr ""
717 "Die folgende Header-Datei wird von den »Lese«- und »Schreibe«-Programmen "
718 "eingebunden:"
719
720 #. type: Plain text
721 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
722 #: opensuse-tumbleweed
723 #, no-wrap
724 msgid ""
725 "/* svshm_string.h\n"
726 "\\&\n"
727 " Licensed under GNU General Public License v2 or later.\n"
728 "*/\n"
729 "#ifndef SVSHM_STRING_H\n"
730 "#define SVSHM_STRING_H\n"
731 "\\&\n"
732 "#include E<lt>err.hE<gt>\n"
733 "#include E<lt>stdio.hE<gt>\n"
734 "#include E<lt>stdlib.hE<gt>\n"
735 "#include E<lt>sys/sem.hE<gt>\n"
736 "\\&\n"
737 "union semun { /* Used in calls to semctl() */\n"
738 " int val;\n"
739 " struct semid_ds *buf;\n"
740 " unsigned short *array;\n"
741 "#if defined(__linux__)\n"
742 " struct seminfo *__buf;\n"
743 "#endif\n"
744 "};\n"
745 "\\&\n"
746 "#define MEM_SIZE 4096\n"
747 "\\&\n"
748 "#endif // include guard\n"
749 msgstr ""
750 "/* svshm_string.h\n"
751 "\\&\n"
752 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
753 "*/\n"
754 "#ifndef SVSHM_STRING_H\n"
755 "#define SVSHM_STRING_H\n"
756 "\\&\n"
757 "#include E<lt>err.hE<gt>\n"
758 "#include E<lt>stdio.hE<gt>\n"
759 "#include E<lt>stdlib.hE<gt>\n"
760 "#include E<lt>sys/sem.hE<gt>\n"
761 "\\&\n"
762 "union semun { /* Wird in Aufrufen von semctl() verwandt */\n"
763 " int val;\n"
764 " struct semid_ds *buf;\n"
765 " unsigned short *array;\n"
766 "#if defined(__linux__)\n"
767 " struct seminfo *__buf;\n"
768 "#endif\n"
769 "};\n"
770 "\\&\n"
771 "#define MEM_SIZE 4096\n"
772
773 #. type: SS
774 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
775 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
776 #, no-wrap
777 msgid "Program source: svshm_string_read.c"
778 msgstr "Quelle des Programms: svshm_string_read.c"
779
780 #. type: Plain text
781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
783 msgid ""
784 "The \"reader\" program creates a shared memory segment and a semaphore set "
785 "containing one semaphore. It then attaches the shared memory object into "
786 "its address space and initializes the semaphore value to 1. Finally, the "
787 "program waits for the semaphore value to become 0, and afterwards prints the "
788 "string that has been copied into the shared memory segment by the \"writer\"."
789 msgstr ""
790 "Das »Lese«-Programm erstellt ein gemeinsam benutztes Speichersegment und "
791 "eine Semaphore-Gruppe, die eine Semaphore enthält. Es blendet dann das "
792 "gemeinsam benutzte Speicherobjekt in seinen Adressraum ein und initialisiert "
793 "den Semaphoren-Wert auf 1. Schließlich wartet das Programm darauf, dass der "
794 "Semaphoren-Wert 0 wird und gibt danach die Zeichenkette aus, die durch den "
795 "»Schreiber« in das gemeinsam benutzte Speichersegment kopiert wurde."
796
797 #. type: Plain text
798 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
799 #: opensuse-tumbleweed
800 #, no-wrap
801 msgid ""
802 "/* svshm_string_read.c\n"
803 "\\&\n"
804 " Licensed under GNU General Public License v2 or later.\n"
805 "*/\n"
806 "#include E<lt>err.hE<gt>\n"
807 "#include E<lt>stdio.hE<gt>\n"
808 "#include E<lt>stdlib.hE<gt>\n"
809 "#include E<lt>sys/ipc.hE<gt>\n"
810 "#include E<lt>sys/sem.hE<gt>\n"
811 "#include E<lt>sys/shm.hE<gt>\n"
812 "\\&\n"
813 "#include \"svshm_string.h\"\n"
814 "\\&\n"
815 "int\n"
816 "main(void)\n"
817 "{\n"
818 " int semid, shmid;\n"
819 " char *addr;\n"
820 " union semun arg, dummy;\n"
821 " struct sembuf sop;\n"
822 "\\&\n"
823 " /* Create shared memory and semaphore set containing one\n"
824 " semaphore. */\n"
825 "\\&\n"
826 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
827 " if (shmid == -1)\n"
828 " err(EXIT_FAILURE, \"shmget\");\n"
829 "\\&\n"
830 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
831 " if (semid == -1)\n"
832 " err(EXIT_FAILURE, \"semget\");\n"
833 "\\&\n"
834 " /* Attach shared memory into our address space. */\n"
835 "\\&\n"
836 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
837 " if (addr == (void *) -1)\n"
838 " err(EXIT_FAILURE, \"shmat\");\n"
839 "\\&\n"
840 " /* Initialize semaphore 0 in set with value 1. */\n"
841 "\\&\n"
842 " arg.val = 1;\n"
843 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
844 " err(EXIT_FAILURE, \"semctl\");\n"
845 "\\&\n"
846 " printf(\"shmid = %d\\[rs]n\", shmid);\n"
847 " printf(\"semid = %d\\[rs]n\", semid);\n"
848 "\\&\n"
849 " /* Wait for semaphore value to become 0. */\n"
850 "\\&\n"
851 " sop.sem_num = 0;\n"
852 " sop.sem_op = 0;\n"
853 " sop.sem_flg = 0;\n"
854 "\\&\n"
855 " if (semop(semid, &sop, 1) == -1)\n"
856 " err(EXIT_FAILURE, \"semop\");\n"
857 "\\&\n"
858 " /* Print the string from shared memory. */\n"
859 "\\&\n"
860 " printf(\"%s\\[rs]n\", addr);\n"
861 "\\&\n"
862 " /* Remove shared memory and semaphore set. */\n"
863 "\\&\n"
864 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
865 " err(EXIT_FAILURE, \"shmctl\");\n"
866 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
867 " err(EXIT_FAILURE, \"semctl\");\n"
868 "\\&\n"
869 " exit(EXIT_SUCCESS);\n"
870 "}\n"
871 msgstr ""
872 "/* svshm_string_read.c\n"
873 "\\&\n"
874 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
875 "*/\n"
876 "#include E<lt>err.hE<gt>\n"
877 "#include E<lt>stdio.hE<gt>\n"
878 "#include E<lt>stdlib.hE<gt>\n"
879 "#include E<lt>sys/ipc.hE<gt>\n"
880 "#include E<lt>sys/sem.hE<gt>\n"
881 "#include E<lt>sys/shm.hE<gt>\n"
882 "\\&\n"
883 "#include \"svshm_string.h\"\n"
884 "\\&\n"
885 "int\n"
886 "main(void)\n"
887 "{\n"
888 " int semid, shmid;\n"
889 " char *addr;\n"
890 " union semun arg, dummy;\n"
891 " struct sembuf sop;\n"
892 "\\&\n"
893 " /* Gemeinsam benutzten Speicher und eine Semaphoren-Gruppe, die eine\n"
894 " Semaphore enthält, erstellen. */\n"
895 "\\&\n"
896 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
897 " if (shmid == -1)\n"
898 " err(EXIT_FAILURE,\"shmget\");\n"
899 "\\&\n"
900 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
901 " if (semid == -1)\n"
902 " err(EXIT_FAILURE,\"semget\");\n"
903 "\\&\n"
904 " /* Gemeinsamen Speicher in unseren Adressraum einblenden. */\n"
905 "\\&\n"
906 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
907 " if (addr == (void *) -1)\n"
908 " err(EXIT_FAILURE,\"shmat\");\n"
909 "\\&\n"
910 " /* Semaphore 0 in der Gruppe mit dem Wert 1 initialisieren. */\n"
911 "\\&\n"
912 " arg.val = 1;\n"
913 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
914 " err(EXIT_FAILURE,\"semctl\");\n"
915 "\\&\n"
916 " printf(\"shmid = %d\\[rs]n\", shmid);\n"
917 " printf(\"semid = %d\\[rs]n\", semid);\n"
918 "\\&\n"
919 " /* Darauf warten, dass der Semaphore-Wert 0 wird. */\n"
920 "\\&\n"
921 " sop.sem_num = 0;\n"
922 " sop.sem_op = 0;\n"
923 " sop.sem_flg = 0;\n"
924 "\\&\n"
925 " if (semop(semid, &sop, 1) == -1)\n"
926 " err(EXIT_FAILURE,\"semop\");\n"
927 "\\&\n"
928 " /* Die Zeichenkette aus dem gemeinsamen Speicher ausgeben. */\n"
929 "\\&\n"
930 " printf(\"%s\\[rs]n\", addr);\n"
931 "\\&\n"
932 " /* Den gemeinsam benutzten Speicher und die Semaphoren-Gruppe entfernen. */\n"
933 "\\&\n"
934 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
935 " err(EXIT_FAILURE,\"shmctl\");\n"
936 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
937 " err(EXIT_FAILURE,\"semctl\");\n"
938 "\\&\n"
939 " exit(EXIT_SUCCESS);\n"
940 "}\n"
941
942 #. type: SS
943 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
944 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
945 #, no-wrap
946 msgid "Program source: svshm_string_write.c"
947 msgstr "Quelle des Programms: svshm_string_write.c"
948
949 #. type: Plain text
950 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
951 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
952 msgid ""
953 "The writer program takes three command-line arguments: the IDs of the shared "
954 "memory segment and semaphore set that have already been created by the "
955 "\"reader\", and a string. It attaches the shared memory segment into its "
956 "address space, and then decrements the semaphore value to 0 in order to "
957 "inform the \"reader\" that it can now examine the contents of the shared "
958 "memory."
959 msgstr ""
960 "Das Schreibe-Programm akzeptiert drei Befehlszeilenargumente: die Kennungen "
961 "des vom »Lese«-Programm bereits erstellten, gemeinsam benutzten "
962 "Speichersegments und die Sempahoren-Gruppe und eine Zeichenkette. Es blendet "
963 "das bestehende gemeinsam benutzte Speichersegment in seinen Adressraum ein, "
964 "verringert den Semaphoren-Wert auf 0, um den »Leser« zu informieren, dass er "
965 "jetzt den Inhalt des gemeinsam benutzten Speichers untersuchen kann."
966
967 #. type: Plain text
968 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
969 #: opensuse-tumbleweed
970 #, no-wrap
971 msgid ""
972 "/* svshm_string_write.c\n"
973 "\\&\n"
974 " Licensed under GNU General Public License v2 or later.\n"
975 "*/\n"
976 "#include E<lt>err.hE<gt>\n"
977 "#include E<lt>stdio.hE<gt>\n"
978 "#include E<lt>stdlib.hE<gt>\n"
979 "#include E<lt>string.hE<gt>\n"
980 "#include E<lt>sys/sem.hE<gt>\n"
981 "#include E<lt>sys/shm.hE<gt>\n"
982 "\\&\n"
983 "#include \"svshm_string.h\"\n"
984 "\\&\n"
985 "int\n"
986 "main(int argc, char *argv[])\n"
987 "{\n"
988 " int semid, shmid;\n"
989 " char *addr;\n"
990 " size_t size;\n"
991 " struct sembuf sop;\n"
992 "\\&\n"
993 " if (argc != 4) {\n"
994 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
995 " exit(EXIT_FAILURE);\n"
996 " }\n"
997 "\\&\n"
998 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
999 " if (size E<gt> MEM_SIZE) {\n"
1000 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1001 " exit(EXIT_FAILURE);\n"
1002 " }\n"
1003 "\\&\n"
1004 " /* Get object IDs from command-line. */\n"
1005 "\\&\n"
1006 " shmid = atoi(argv[1]);\n"
1007 " semid = atoi(argv[2]);\n"
1008 "\\&\n"
1009 " /* Attach shared memory into our address space and copy string\n"
1010 " (including trailing null byte) into memory. */\n"
1011 "\\&\n"
1012 " addr = shmat(shmid, NULL, 0);\n"
1013 " if (addr == (void *) -1)\n"
1014 " err(EXIT_FAILURE, \"shmat\");\n"
1015 "\\&\n"
1016 " memcpy(addr, argv[3], size);\n"
1017 "\\&\n"
1018 " /* Decrement semaphore to 0. */\n"
1019 "\\&\n"
1020 " sop.sem_num = 0;\n"
1021 " sop.sem_op = -1;\n"
1022 " sop.sem_flg = 0;\n"
1023 "\\&\n"
1024 " if (semop(semid, &sop, 1) == -1)\n"
1025 " err(EXIT_FAILURE, \"semop\");\n"
1026 "\\&\n"
1027 " exit(EXIT_SUCCESS);\n"
1028 "}\n"
1029 msgstr ""
1030 "/* svshm_string_write.c\n"
1031 "\\&\n"
1032 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
1033 "*/\n"
1034 "#include E<lt>err.hE<gt>\n"
1035 "#include E<lt>stdio.hE<gt>\n"
1036 "#include E<lt>stdlib.hE<gt>\n"
1037 "#include E<lt>string.hE<gt>\n"
1038 "#include E<lt>sys/sem.hE<gt>\n"
1039 "#include E<lt>sys/shm.hE<gt>\n"
1040 "\\&\n"
1041 "#include \"svshm_string.h\"\n"
1042 "\\&\n"
1043 "int\n"
1044 "main(int argc, char *argv[])\n"
1045 "{\n"
1046 " int semid, shmid;\n"
1047 " char *addr;\n"
1048 " size_t size;\n"
1049 " struct sembuf sop;\n"
1050 "\\&\n"
1051 " if (argc != 4) {\n"
1052 " fprintf(stderr, \"Aufruf: %s shmid semid string\\[rs]n\", argv[0]);\n"
1053 " exit(EXIT_FAILURE);\n"
1054 " }\n"
1055 "\\&\n"
1056 " size = strlen(argv[3]) + 1; /* +1, um abschließende »\\[rs]0« einzuschließen */\n"
1057 " if (size E<gt> MEM_SIZE) {\n"
1058 " fprintf(stderr, \"Zeichenkette ist zu groß!\\[rs]n\");\n"
1059 " exit(EXIT_FAILURE);\n"
1060 " }\n"
1061 "\\&\n"
1062 " /* Objektkennungen von der Befehlszeile erhalten. */\n"
1063 "\\&\n"
1064 " shmid = atoi(argv[1]);\n"
1065 " semid = atoi(argv[2]);\n"
1066 "\\&\n"
1067 " /* Gemeinsam benutzten Speicher in unseren Adressraum einblenden und Zeichenkette\n"
1068 " (einschließlich abschließendem Nullbyte) in den Speicher kopieren */\n"
1069 "\\&\n"
1070 " addr = shmat(shmid, NULL, 0);\n"
1071 " if (addr == (void *) -1)\n"
1072 " err(EXIT_FAILURE, \"shmat\");\n"
1073 "\\&\n"
1074 " memcpy(addr, argv[3], size);\n"
1075 "\\&\n"
1076 " /* Semaphore auf 0 verringern. */\n"
1077 "\\&\n"
1078 " sop.sem_num = 0;\n"
1079 " sop.sem_op = -1;\n"
1080 " sop.sem_flg = 0;\n"
1081 "\\&\n"
1082 " if (semop(semid, &sop, 1) == -1)\n"
1083 " err(EXIT_FAILURE, \"semop\");\n"
1084 "\\&\n"
1085 " exit(EXIT_SUCCESS);\n"
1086 "}\n"
1087
1088 #. type: SH
1089 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1090 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1091 #, no-wrap
1092 msgid "SEE ALSO"
1093 msgstr "SIEHE AUCH"
1094
1095 #. type: Plain text
1096 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1097 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1098 msgid ""
1099 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
1100 "B<shm_overview>(7), B<sysvipc>(7)"
1101 msgstr ""
1102 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
1103 "B<shm_overview>(7), B<sysvipc>(7)"
1104
1105 #. type: TH
1106 #: debian-trixie
1107 #, no-wrap
1108 msgid "2024-06-15"
1109 msgstr "15. Juni 2024"
1110
1111 #. type: TH
1112 #: debian-trixie
1113 #, no-wrap
1114 msgid "Linux man-pages 6.9.1"
1115 msgstr "Linux man-pages 6.9.1"
1116
1117 #. type: Plain text
1118 #: debian-trixie
1119 msgid "Standard C library (I<libc>, I<-lc>)"
1120 msgstr "Standard-C-Bibliothek (I<libc>, I<-lc>)"
1121
1122 #. type: Plain text
1123 #: debian-trixie fedora-44 fedora-rawhide
1124 msgid ""
1125 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
1126 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
1127 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
1128 msgstr ""
1129 "Ungültiger I<shmid>-Wert, nicht ausgerichteter (d.h. nicht an die "
1130 "Seitengröße angepasst und B<SHM_RND> wurde nicht angegeben) oder ungültiger "
1131 "I<shmaddr>-Wert oder es wurde B<SHM_REMAP> angegeben und I<shmaddr> war NULL."
1132
1133 #. type: Plain text
1134 #: debian-trixie fedora-44 fedora-rawhide
1135 #, no-wrap
1136 msgid ""
1137 "$ B<./svshm_string_read>\n"
1138 "shmid = 1114194; semid = 15\n"
1139 msgstr ""
1140 "$ B<./svshm_string_read>\n"
1141 "shmid = 1114194; semid = 15\n"
1142
1143 #. type: Plain text
1144 #: debian-trixie fedora-44 fedora-rawhide
1145 #, no-wrap
1146 msgid "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
1147 msgstr "$ B<./svshm_string_write 1114194 15 \\[aq]Hallo, Welt\\[aq]>\n"
1148
1149 #. type: Plain text
1150 #: debian-trixie fedora-44 fedora-rawhide
1151 #, no-wrap
1152 msgid ""
1153 "/* svshm_string.h\n"
1154 "\\&\n"
1155 " Licensed under GNU General Public License v2 or later.\n"
1156 "*/\n"
1157 "#ifndef SVSHM_STRING_H\n"
1158 "#define SVSHM_STRING_H\n"
1159 "\\&\n"
1160 "#include E<lt>stdio.hE<gt>\n"
1161 "#include E<lt>stdlib.hE<gt>\n"
1162 "#include E<lt>sys/sem.hE<gt>\n"
1163 "\\&\n"
1164 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1165 " } while (0)\n"
1166 "\\&\n"
1167 "union semun { /* Used in calls to semctl() */\n"
1168 " int val;\n"
1169 " struct semid_ds *buf;\n"
1170 " unsigned short *array;\n"
1171 "#if defined(__linux__)\n"
1172 " struct seminfo *__buf;\n"
1173 "#endif\n"
1174 "};\n"
1175 "\\&\n"
1176 "#define MEM_SIZE 4096\n"
1177 "\\&\n"
1178 "#endif // include guard\n"
1179 msgstr ""
1180 "/* svshm_string.h\n"
1181 "\\&\n"
1182 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
1183 "*/\n"
1184 "#ifndef SVSHM_STRING_H\n"
1185 "#define SVSHM_STRING_H\n"
1186 "\\&\n"
1187 "#include E<lt>stdio.hE<gt>\n"
1188 "#include E<lt>stdlib.hE<gt>\n"
1189 "#include E<lt>sys/sem.hE<gt>\n"
1190 "\\&\n"
1191 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1192 " } while (0)\n"
1193 "\\&\n"
1194 "union semun { /* Wird in Aufrufen von semctl() verwandt */\n"
1195 " int val;\n"
1196 " struct semid_ds *buf;\n"
1197 " unsigned short *array;\n"
1198 "#if defined(__linux__)\n"
1199 " struct seminfo *__buf;\n"
1200 "#endif\n"
1201 "};\n"
1202 "\\&\n"
1203 "#define MEM_SIZE 4096\n"
1204
1205 #. type: Plain text
1206 #: debian-trixie fedora-44 fedora-rawhide
1207 #, no-wrap
1208 msgid ""
1209 "/* svshm_string_read.c\n"
1210 "\\&\n"
1211 " Licensed under GNU General Public License v2 or later.\n"
1212 "*/\n"
1213 "#include E<lt>stdio.hE<gt>\n"
1214 "#include E<lt>stdlib.hE<gt>\n"
1215 "#include E<lt>sys/ipc.hE<gt>\n"
1216 "#include E<lt>sys/sem.hE<gt>\n"
1217 "#include E<lt>sys/shm.hE<gt>\n"
1218 "\\&\n"
1219 "#include \"svshm_string.h\"\n"
1220 "\\&\n"
1221 "int\n"
1222 "main(void)\n"
1223 "{\n"
1224 " int semid, shmid;\n"
1225 " char *addr;\n"
1226 " union semun arg, dummy;\n"
1227 " struct sembuf sop;\n"
1228 "\\&\n"
1229 " /* Create shared memory and semaphore set containing one\n"
1230 " semaphore. */\n"
1231 "\\&\n"
1232 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
1233 " if (shmid == -1)\n"
1234 " errExit(\"shmget\");\n"
1235 "\\&\n"
1236 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
1237 " if (semid == -1)\n"
1238 " errExit(\"semget\");\n"
1239 "\\&\n"
1240 " /* Attach shared memory into our address space. */\n"
1241 "\\&\n"
1242 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
1243 " if (addr == (void *) -1)\n"
1244 " errExit(\"shmat\");\n"
1245 "\\&\n"
1246 " /* Initialize semaphore 0 in set with value 1. */\n"
1247 "\\&\n"
1248 " arg.val = 1;\n"
1249 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
1250 " errExit(\"semctl\");\n"
1251 "\\&\n"
1252 " printf(\"shmid = %d; semid = %d\\[rs]n\", shmid, semid);\n"
1253 "\\&\n"
1254 " /* Wait for semaphore value to become 0. */\n"
1255 "\\&\n"
1256 " sop.sem_num = 0;\n"
1257 " sop.sem_op = 0;\n"
1258 " sop.sem_flg = 0;\n"
1259 "\\&\n"
1260 " if (semop(semid, &sop, 1) == -1)\n"
1261 " errExit(\"semop\");\n"
1262 "\\&\n"
1263 " /* Print the string from shared memory. */\n"
1264 "\\&\n"
1265 " printf(\"%s\\[rs]n\", addr);\n"
1266 "\\&\n"
1267 " /* Remove shared memory and semaphore set. */\n"
1268 "\\&\n"
1269 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
1270 " errExit(\"shmctl\");\n"
1271 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
1272 " errExit(\"semctl\");\n"
1273 "\\&\n"
1274 " exit(EXIT_SUCCESS);\n"
1275 "}\n"
1276 msgstr ""
1277 "/* svshm_string_read.c\n"
1278 "\\&\n"
1279 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
1280 "*/\n"
1281 "#include E<lt>stdio.hE<gt>\n"
1282 "#include E<lt>stdlib.hE<gt>\n"
1283 "#include E<lt>sys/ipc.hE<gt>\n"
1284 "#include E<lt>sys/sem.hE<gt>\n"
1285 "#include E<lt>sys/shm.hE<gt>\n"
1286 "\\&\n"
1287 "#include \"svshm_string.h\"\n"
1288 "\\&\n"
1289 "int\n"
1290 "main(void)\n"
1291 "{\n"
1292 " int semid, shmid;\n"
1293 " char *addr;\n"
1294 " union semun arg, dummy;\n"
1295 " struct sembuf sop;\n"
1296 "\\&\n"
1297 " /* Gemeinsam benutzten Speicher und eine Semaphoren-Gruppe, die eine\n"
1298 " Semaphore enthält, erstellen. */\n"
1299 "\\&\n"
1300 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
1301 " if (shmid == -1)\n"
1302 " errExit(\"shmget\");\n"
1303 "\\&\n"
1304 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
1305 " if (semid == -1)\n"
1306 " errExit(\"semget\");\n"
1307 "\\&\n"
1308 " /* Gemeinsamen Speicher in unseren Adressraum einblenden. */\n"
1309 "\\&\n"
1310 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
1311 " if (addr == (void *) -1)\n"
1312 " errExit(\"shmat\");\n"
1313 "\\&\n"
1314 " /* Semaphore 0 in der Gruppe mit dem Wert 1 initialisieren. */\n"
1315 "\\&\n"
1316 " arg.val = 1;\n"
1317 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
1318 " errExit(\"semctl\");\n"
1319 "\\&\n"
1320 " printf(\"shmid = %d; semid = %d\\[rs]n\", shmid, semid);\n"
1321 "\\&\n"
1322 " /* Darauf warten, dass der Semaphore-Wert 0 wird. */\n"
1323 "\\&\n"
1324 " sop.sem_num = 0;\n"
1325 " sop.sem_op = 0;\n"
1326 " sop.sem_flg = 0;\n"
1327 "\\&\n"
1328 " if (semop(semid, &sop, 1) == -1)\n"
1329 " errExit(\"semop\");\n"
1330 "\\&\n"
1331 " /* Die Zeichenkette aus dem gemeinsamen Speicher ausgeben. */\n"
1332 "\\&\n"
1333 " printf(\"%s\\[rs]n\", addr);\n"
1334 "\\&\n"
1335 " /* Den gemeinsam benutzten Speicher und die Semaphoren-Gruppe entfernen. */\n"
1336 "\\&\n"
1337 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
1338 " errExit(\"shmctl\");\n"
1339 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
1340 " errExit(\"semctl\");\n"
1341 "\\&\n"
1342 " exit(EXIT_SUCCESS);\n"
1343 "}\n"
1344
1345 #. type: Plain text
1346 #: debian-trixie
1347 #, no-wrap
1348 msgid ""
1349 "/* svshm_string_write.c\n"
1350 "\\&\n"
1351 " Licensed under GNU General Public License v2 or later.\n"
1352 "*/\n"
1353 "#include E<lt>stdio.hE<gt>\n"
1354 "#include E<lt>stdlib.hE<gt>\n"
1355 "#include E<lt>string.hE<gt>\n"
1356 "#include E<lt>sys/sem.hE<gt>\n"
1357 "#include E<lt>sys/shm.hE<gt>\n"
1358 "\\&\n"
1359 "#include \"svshm_string.h\"\n"
1360 "\\&\n"
1361 "int\n"
1362 "main(int argc, char *argv[])\n"
1363 "{\n"
1364 " int semid, shmid;\n"
1365 " char *addr;\n"
1366 " size_t len;\n"
1367 " struct sembuf sop;\n"
1368 "\\&\n"
1369 " if (argc != 4) {\n"
1370 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1371 " exit(EXIT_FAILURE);\n"
1372 " }\n"
1373 "\\&\n"
1374 " len = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1375 " if (len E<gt> MEM_SIZE) {\n"
1376 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1377 " exit(EXIT_FAILURE);\n"
1378 " }\n"
1379 "\\&\n"
1380 " /* Get object IDs from command-line. */\n"
1381 "\\&\n"
1382 " shmid = atoi(argv[1]);\n"
1383 " semid = atoi(argv[2]);\n"
1384 "\\&\n"
1385 " /* Attach shared memory into our address space and copy string\n"
1386 " (including trailing null byte) into memory. */\n"
1387 "\\&\n"
1388 " addr = shmat(shmid, NULL, 0);\n"
1389 " if (addr == (void *) -1)\n"
1390 " errExit(\"shmat\");\n"
1391 "\\&\n"
1392 " memcpy(addr, argv[3], len);\n"
1393 "\\&\n"
1394 " /* Decrement semaphore to 0. */\n"
1395 "\\&\n"
1396 " sop.sem_num = 0;\n"
1397 " sop.sem_op = -1;\n"
1398 " sop.sem_flg = 0;\n"
1399 "\\&\n"
1400 " if (semop(semid, &sop, 1) == -1)\n"
1401 " errExit(\"semop\");\n"
1402 "\\&\n"
1403 " exit(EXIT_SUCCESS);\n"
1404 "}\n"
1405 msgstr ""
1406 "/* svshm_string_write.c\n"
1407 "\\&\n"
1408 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
1409 "*/\n"
1410 "#include E<lt>stdio.hE<gt>\n"
1411 "#include E<lt>stdlib.hE<gt>\n"
1412 "#include E<lt>string.hE<gt>\n"
1413 "#include E<lt>sys/sem.hE<gt>\n"
1414 "#include E<lt>sys/shm.hE<gt>\n"
1415 "\\&\n"
1416 "#include \"svshm_string.h\"\n"
1417 "\\&\n"
1418 "int\n"
1419 "main(int argc, char *argv[])\n"
1420 "{\n"
1421 " int semid, shmid;\n"
1422 " char *addr;\n"
1423 " size_t len;\n"
1424 " struct sembuf sop;\n"
1425 "\\&\n"
1426 " if (argc != 4) {\n"
1427 " fprintf(stderr, \"Aufruf: %s shmid semid string\\[rs]n\", argv[0]);\n"
1428 " exit(EXIT_FAILURE);\n"
1429 " }\n"
1430 "\\&\n"
1431 " len = strlen(argv[3]) + 1; /* +1, um abschließende »\\[rs]0« einzuschließen */\n"
1432 " if (len E<gt> MEM_SIZE) {\n"
1433 " fprintf(stderr, \"Zeichenkette ist zu groß!\\[rs]n\");\n"
1434 " exit(EXIT_FAILURE);\n"
1435 " }\n"
1436 "\\&\n"
1437 " /* Objektkennungen von der Befehlszeile erhalten. */\n"
1438 "\\&\n"
1439 " shmid = atoi(argv[1]);\n"
1440 " semid = atoi(argv[2]);\n"
1441 "\\&\n"
1442 " /* Gemeinsam benutzten Speicher in unseren Adressraum einblenden und Zeichenkette\n"
1443 " (einschließlich abschließendem Nullbyte) in den Speicher kopieren */\n"
1444 "\\&\n"
1445 " addr = shmat(shmid, NULL, 0);\n"
1446 " if (addr == (void *) -1)\n"
1447 " errExit(\"shmat\");\n"
1448 "\\&\n"
1449 " memcpy(addr, argv[3], len);\n"
1450 "\\&\n"
1451 " /* Semaphore auf 0 verringern. */\n"
1452 "\\&\n"
1453 " sop.sem_num = 0;\n"
1454 " sop.sem_op = -1;\n"
1455 " sop.sem_flg = 0;\n"
1456 "\\&\n"
1457 " if (semop(semid, &sop, 1) == -1)\n"
1458 " errExit(\"semop\");\n"
1459 "\\&\n"
1460 " exit(EXIT_SUCCESS);\n"
1461 "}\n"
1462
1463 #. type: TH
1464 #: fedora-44 fedora-rawhide
1465 #, no-wrap
1466 msgid "2024-11-17"
1467 msgstr "17. November 2024"
1468
1469 #. type: TH
1470 #: fedora-44 fedora-rawhide
1471 #, no-wrap
1472 msgid "Linux man-pages 6.13"
1473 msgstr "Linux man-pages 6.13"
1474
1475 #. type: Plain text
1476 #: fedora-44 fedora-rawhide
1477 #, no-wrap
1478 msgid ""
1479 "/* svshm_string_write.c\n"
1480 "\\&\n"
1481 " Licensed under GNU General Public License v2 or later.\n"
1482 "*/\n"
1483 "#include E<lt>stdio.hE<gt>\n"
1484 "#include E<lt>stdlib.hE<gt>\n"
1485 "#include E<lt>string.hE<gt>\n"
1486 "#include E<lt>sys/sem.hE<gt>\n"
1487 "#include E<lt>sys/shm.hE<gt>\n"
1488 "\\&\n"
1489 "#include \"svshm_string.h\"\n"
1490 "\\&\n"
1491 "int\n"
1492 "main(int argc, char *argv[])\n"
1493 "{\n"
1494 " int semid, shmid;\n"
1495 " char *addr;\n"
1496 " size_t size;\n"
1497 " struct sembuf sop;\n"
1498 "\\&\n"
1499 " if (argc != 4) {\n"
1500 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1501 " exit(EXIT_FAILURE);\n"
1502 " }\n"
1503 "\\&\n"
1504 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1505 " if (size E<gt> MEM_SIZE) {\n"
1506 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1507 " exit(EXIT_FAILURE);\n"
1508 " }\n"
1509 "\\&\n"
1510 " /* Get object IDs from command-line. */\n"
1511 "\\&\n"
1512 " shmid = atoi(argv[1]);\n"
1513 " semid = atoi(argv[2]);\n"
1514 "\\&\n"
1515 " /* Attach shared memory into our address space and copy string\n"
1516 " (including trailing null byte) into memory. */\n"
1517 "\\&\n"
1518 " addr = shmat(shmid, NULL, 0);\n"
1519 " if (addr == (void *) -1)\n"
1520 " errExit(\"shmat\");\n"
1521 "\\&\n"
1522 " memcpy(addr, argv[3], size);\n"
1523 "\\&\n"
1524 " /* Decrement semaphore to 0. */\n"
1525 "\\&\n"
1526 " sop.sem_num = 0;\n"
1527 " sop.sem_op = -1;\n"
1528 " sop.sem_flg = 0;\n"
1529 "\\&\n"
1530 " if (semop(semid, &sop, 1) == -1)\n"
1531 " errExit(\"semop\");\n"
1532 "\\&\n"
1533 " exit(EXIT_SUCCESS);\n"
1534 "}\n"
1535 msgstr ""
1536 "/* svshm_string_write.c\n"
1537 "\\&\n"
1538 " Lizenziert unter der GNU General Public License v2 oder neuer.\n"
1539 "*/\n"
1540 "#include E<lt>stdio.hE<gt>\n"
1541 "#include E<lt>stdlib.hE<gt>\n"
1542 "#include E<lt>string.hE<gt>\n"
1543 "#include E<lt>sys/sem.hE<gt>\n"
1544 "#include E<lt>sys/shm.hE<gt>\n"
1545 "\\&\n"
1546 "#include \"svshm_string.h\"\n"
1547 "\\&\n"
1548 "int\n"
1549 "main(int argc, char *argv[])\n"
1550 "{\n"
1551 " int semid, shmid;\n"
1552 " char *addr;\n"
1553 " size_t size;\n"
1554 " struct sembuf sop;\n"
1555 "\\&\n"
1556 " if (argc != 4) {\n"
1557 " fprintf(stderr, \"Aufruf: %s shmid semid string\\[rs]n\", argv[0]);\n"
1558 " exit(EXIT_FAILURE);\n"
1559 " }\n"
1560 "\\&\n"
1561 " size = strlen(argv[3]) + 1; /* +1, um abschließende »\\[rs]0« einzuschließen */\n"
1562 " if (size E<gt> MEM_SIZE) {\n"
1563 " fprintf(stderr, \"Zeichenkette ist zu groß!\\[rs]n\");\n"
1564 " exit(EXIT_FAILURE);\n"
1565 " }\n"
1566 "\\&\n"
1567 " /* Objektkennungen von der Befehlszeile erhalten. */\n"
1568 "\\&\n"
1569 " shmid = atoi(argv[1]);\n"
1570 " semid = atoi(argv[2]);\n"
1571 "\\&\n"
1572 " /* Gemeinsam benutzten Speicher in unseren Adressraum einblenden und Zeichenkette\n"
1573 " (einschließlich abschließendem Nullbyte) in den Speicher kopieren */\n"
1574 "\\&\n"
1575 " addr = shmat(shmid, NULL, 0);\n"
1576 " if (addr == (void *) -1)\n"
1577 " errExit(\"shmat\");\n"
1578 "\\&\n"
1579 " memcpy(addr, argv[3], size);\n"
1580 "\\&\n"
1581 " /* Semaphore auf 0 verringern. */\n"
1582 "\\&\n"
1583 " sop.sem_num = 0;\n"
1584 " sop.sem_op = -1;\n"
1585 " sop.sem_flg = 0;\n"
1586 "\\&\n"
1587 " if (semop(semid, &sop, 1) == -1)\n"
1588 " errExit(\"semop\");\n"
1589 "\\&\n"
1590 " exit(EXIT_SUCCESS);\n"
1591 "}\n"
1592
1593 #. type: TH
1594 #: mageia-cauldron
1595 #, no-wrap
1596 msgid "Linux man-pages 6.17"
1597 msgstr "Linux man-pages 6.17"
1598
1599 #. type: TH
1600 #: opensuse-leap-16-1 opensuse-tumbleweed
1601 #, no-wrap
1602 msgid "Linux man-pages (unreleased)"
1603 msgstr "Linux man-pages (unveröffentlicht)"