Debian Codegraph @

po/es/man2/shmop.2.po

raw
1 # Spanish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Gerardo Aburruzaga García <[email protected]>, 1998.
5 # Juan Piernas <[email protected]>, 2000.
6 # Miguel Pérez Ibars <[email protected]>, 2004.
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: manpages-l10n\n"
10 "POT-Creation-Date: 2026-06-05 06:43+0200\n"
11 "PO-Revision-Date: 2004-12-01 19:53+0200\n"
12 "Last-Translator: Miguel Pérez Ibars <[email protected]>\n"
13 "Language-Team: Spanish <[email protected]>\n"
14 "Language: es\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 "X-Generator: Lokalize 20.04.1\n"
20
21 #. type: TH
22 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
23 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
24 #, no-wrap
25 msgid "SHMOP"
26 msgstr "SHMOP"
27
28 #. type: TH
29 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
30 #: opensuse-tumbleweed
31 #, no-wrap
32 msgid "2026-02-08"
33 msgstr "8 Febrero 2026"
34
35 #. type: TH
36 #: archlinux debian-unstable
37 #, fuzzy, no-wrap
38 #| msgid "Linux man-pages 6.17"
39 msgid "Linux man-pages 6.18"
40 msgstr "Páginas de Manual de Linux 6.17"
41
42 #. type: SH
43 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
44 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
45 #, no-wrap
46 msgid "NAME"
47 msgstr "NOMBRE"
48
49 #. type: Plain text
50 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
51 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
52 #, fuzzy
53 #| msgid "shmop - shared memory operations"
54 msgid "shmat, shmdt - System V shared memory operations"
55 msgstr "shmop - operaciones con memoria compartida"
56
57 #. type: SH
58 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
59 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
60 #, no-wrap
61 msgid "LIBRARY"
62 msgstr "BIBLIOTECA"
63
64 #. type: Plain text
65 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
66 #: opensuse-leap-16-1 opensuse-tumbleweed
67 msgid "Standard C library (I<libc>,\\ I<-lc>)"
68 msgstr "Biblioteca Estándar C (I<libc>,\\ I<-lc>)"
69
70 #. type: SH
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 #, no-wrap
74 msgid "SYNOPSIS"
75 msgstr "SINOPSIS"
76
77 #. type: Plain text
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "B<#include E<lt>sys/shm.hE<gt>>\n"
82 msgstr "B<#include E<lt>sys/shm.hE<gt>>\n"
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, fuzzy, no-wrap
88 #| msgid "B<void *shmat(int >I<shmid>B<, const void *>I<shmaddr>B<, int >I<shmflg>B<);>\n"
89 msgid ""
90 "B<void *shmat(int >I<shmid>B<, const void *_Nullable >I<shmaddr>B<, int >I<shmflg>B<);>\n"
91 "B<int shmdt(const void *>I<shmaddr>B<);>\n"
92 msgstr "B<void *shmat(int >I<shmid>B<, const void *>I<shmaddr>B<, int >I<shmflg>B<);>\n"
93
94 #. type: SH
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 #, no-wrap
98 msgid "DESCRIPTION"
99 msgstr "DESCRIPCIÓN"
100
101 #. type: SS
102 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
103 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
104 #, no-wrap
105 msgid "shmat()"
106 msgstr "shmat()"
107
108 #. type: Plain text
109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
111 #, fuzzy
112 #| msgid ""
113 #| "The function B<shmat> attaches the shared memory segment identified by "
114 #| "B<shmid> to the address space of the calling process. The attaching "
115 #| "address is specified by I<shmaddr> with one of the following criteria:"
116 msgid ""
117 "B<shmat>() attaches the System\\ V shared memory segment identified by "
118 "I<shmid> to the address space of the calling process. The attaching address "
119 "is specified by I<shmaddr> with one of the following criteria:"
120 msgstr ""
121 "La función B<shmat> pega el segmento de memoria compartida identificada por "
122 "B<shmid> al espacio de direcciones del proceso que llama a la función. La "
123 "dirección del pegado se especifica en I<shmaddr> según uno de los criterios "
124 "siguientes:"
125
126 #. type: IP
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 #, no-wrap
130 msgid "\\[bu]"
131 msgstr "\\[bu]"
132
133 #. type: Plain text
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 #, fuzzy
137 #| msgid ""
138 #| "If I<shmaddr> is B<NULL>, the system chooses a suitable (unused) address "
139 #| "at which to attach the segment."
140 msgid ""
141 "If I<shmaddr> is NULL, the system chooses a suitable (unused) page-aligned "
142 "address to attach the segment."
143 msgstr ""
144 "Si I<shmaddr> es B<NULL>, el sistema escoge una dirección adecuada (sin "
145 "utilizar) en donde pegar el segmento."
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 #, fuzzy
151 #| msgid ""
152 #| "If I<shmaddr> isn't B<NULL> and B<SHM_RND> is asserted in I<shmflg>, the "
153 #| "attach occurs at the address equal to I<shmaddr> rounded down to the "
154 #| "nearest multiple of B<SHMLBA>. Otherwise I<shmaddr> must be a page-"
155 #| "aligned address at which the attach occurs."
156 msgid ""
157 "If I<shmaddr> isn't NULL and B<SHM_RND> is specified in I<shmflg>, the "
158 "attach occurs at the address equal to I<shmaddr> rounded down to the nearest "
159 "multiple of B<SHMLBA>."
160 msgstr ""
161 "Si I<shmaddr> no es B<NULL> y B<SHM_RND> está activado en I<shmflg>, el "
162 "pegado ocurre en la dirección igual al redondeo por abajo de I<shmaddr> al "
163 "múltiplo más cercano de B<SHMLBA>. De otro modo, I<shmaddr> debe ser una "
164 "dirección alíneada de una página en la cual ocurra el pegado."
165
166 #. type: Plain text
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 msgid ""
170 "Otherwise, I<shmaddr> must be a page-aligned address at which the attach "
171 "occurs."
172 msgstr ""
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 "In addition to B<SHM_RND>, the following flags may be specified in the "
179 "I<shmflg> bit-mask argument:"
180 msgstr ""
181
182 #. type: TP
183 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
184 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
185 #, no-wrap
186 msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
187 msgstr "B<SHM_EXEC> (Específica de Linux, desde Linux 2.6.9)"
188
189 #. type: Plain text
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 msgid ""
193 "Allow the contents of the segment to be executed. The caller must have "
194 "execute permission on the segment."
195 msgstr ""
196
197 #. type: TP
198 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
199 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
200 #, no-wrap
201 msgid "B<SHM_RDONLY>"
202 msgstr "B<SHM_RDONLY>"
203
204 #. type: Plain text
205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
207 #, fuzzy
208 #| msgid ""
209 #| "If B<SHM_RDONLY> is asserted in I<shmflg>, the segment is attached for "
210 #| "reading and the process must have read permission for the segment. "
211 #| "Otherwise the segment is attached for read and write and the process must "
212 #| "have read and write permission for the segment. There is no notion of a "
213 #| "write-only shared memory segment."
214 msgid ""
215 "Attach the segment for read-only access. The process must have read "
216 "permission for the segment. If this flag is not specified, the segment is "
217 "attached for read and write access, and the process must have read and write "
218 "permission for the segment. There is no notion of a write-only shared "
219 "memory segment."
220 msgstr ""
221 "Si B<SHM_RDONLY> está activado en I<shmflg>, el segmento se pega para "
222 "lectura y el proceso debe tener permiso de lectura en el segmento. De otro "
223 "modo el segmento se pega para lectura y escritura y debe tener permisos de "
224 "lectura y escritura en el segmento. No existe la noción de un segmento de "
225 "memoria compartida de escritura exclusiva."
226
227 #. type: TP
228 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
229 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
230 #, no-wrap
231 msgid "B<SHM_REMAP> (Linux-specific)"
232 msgstr "B<SHM_REMAP> (Específica de Linux)"
233
234 #. type: Plain text
235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
237 #, fuzzy
238 #| msgid ""
239 #| "The (Linux-specific) B<SHM_REMAP> flag may be asserted in I<shmflg> to "
240 #| "indicate that the mapping of the segment should replace any existing "
241 #| "mapping in the range starting at I<shmaddr> and continuing for the size "
242 #| "of the segment. (Normally an B<EINVAL> error would result if a mapping "
243 #| "already exists in this address range.) In this case, I<shmaddr> must not "
244 #| "be B<NULL>."
245 msgid ""
246 "This flag specifies that the mapping of the segment should replace any "
247 "existing mapping in the range starting at I<shmaddr> and continuing for the "
248 "size of the segment. (Normally, an B<EINVAL> error would result if a "
249 "mapping already exists in this address range.) In this case, I<shmaddr> "
250 "must not be NULL."
251 msgstr ""
252 "La bandera (específica de Linux) B<SHM_REMAP> puede ser activada en "
253 "I<shmflg> para indicar que la correspondencia del segmento debería "
254 "reemplazar cualquier correspondencia existente en el rango que comienza en "
255 "I<shmaddr> y continua hasta el tamaño del segmento. (Normalmente se "
256 "produciría un error B<EINVAL> si ya existiera una correspondencia en este "
257 "rango de direcciones.) En este caso, I<shmaddr> no debe ser B<NULL>."
258
259 #. type: Plain text
260 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
261 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
262 msgid ""
263 "The B<brk>(2) value of the calling process is not altered by the attach. "
264 "The segment will automatically be detached at process exit. The same "
265 "segment may be attached as a read and as a read-write one, and more than "
266 "once, in the process's address space."
267 msgstr ""
268 "El valor de B<brk>(2) del proceso que llama a la función no se altera por el "
269 "pegado. El segmento se despegará automáticamente cuendo el proceso se "
270 "acabe. El mismo segmento puede ser pegaado como de lectura y de lectura-"
271 "escritura, y más de una vez, en el espacio de direcciones del proceso."
272
273 #. type: Plain text
274 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
275 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
276 #, fuzzy
277 #| msgid ""
278 #| "On a successful B<shmdt> call the system updates the members of the "
279 #| "B<shmid_ds> structure associated with the shared memory segment as "
280 #| "follows:"
281 msgid ""
282 "A successful B<shmat>() call updates the members of the I<shmid_ds> "
283 "structure (see B<shmctl>(2)) associated with the shared memory segment as "
284 "follows:"
285 msgstr ""
286 "Tras una llamada exitosa a B<shmdt> el sistema actualiza los miembros de la "
287 "estructura B<shmid_ds> asociada al segmento de memoria compartida como sigue:"
288
289 #. type: Plain text
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 msgid "I<shm_atime> is set to the current time."
293 msgstr "I<shm_atime> toma el valor de la hora actual."
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid "I<shm_lpid> is set to the process-ID of the calling process."
299 msgstr "I<shm_lpid> toma el valor del PID del proceso llamador."
300
301 #. type: Plain text
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 msgid "I<shm_nattch> is incremented by one."
305 msgstr "I<shm_nattch> se incrementa en uno."
306
307 #. type: SS
308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
310 #, no-wrap
311 msgid "shmdt()"
312 msgstr "shmdt()"
313
314 #. type: Plain text
315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
317 msgid ""
318 "B<shmdt>() detaches the shared memory segment located at the address "
319 "specified by I<shmaddr> from the address space of the calling process. The "
320 "to-be-detached segment must be currently attached with I<shmaddr> equal to "
321 "the value returned by the attaching B<shmat>() call."
322 msgstr ""
323 "B<shmdt>() despega el segmento de memoria compartida localizado en la "
324 "dirección especificada por I<shmaddr> del espacio de direcciones del proceso "
325 "invocador. El segmento a ser despegado debe estar actualmente pegado con "
326 "I<shmaddr> igual al valor devuelto por su llamada de pegado B<shmat>()."
327
328 #. type: Plain text
329 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
330 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
331 msgid ""
332 "On a successful B<shmdt>() call, the system updates the members of the "
333 "I<shmid_ds> structure associated with the shared memory segment as follows:"
334 msgstr ""
335 "Tras una llamada exitosa a B<shmdt>() el sistema actualiza los miembros de "
336 "la estructura I<shmid_ds> asociada al segmento de memoria compartida como "
337 "sigue:"
338
339 #. type: Plain text
340 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
341 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
342 msgid "I<shm_dtime> is set to the current time."
343 msgstr "I<shm_dtime> toma el valor de la hora actual."
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 "I<shm_nattch> is decremented by one. If it becomes 0 and the segment is "
350 "marked for deletion, the segment is deleted."
351 msgstr ""
352 "I<shm_nattch> se decrementa en uno. Si llega a 0 y el segmento está marcado "
353 "para ser borrado, el segmento se borra."
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 "RETURN VALUE"
360 msgstr "VALOR DEVUELTO"
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 #, fuzzy
366 #| msgid ""
367 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
368 #| "set appropriately."
369 msgid ""
370 "On success, B<shmat>() returns the address of the attached shared memory "
371 "segment; on error, I<(void\\ *)\\ -1> is returned, and I<errno> is set to "
372 "indicate the error."
373 msgstr ""
374 "En caso de éxito se devuelve cero. En caso de error se devuelve -1, y "
375 "I<errno> se configura adecuadamente."
376
377 #. type: Plain text
378 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
379 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
380 #, fuzzy
381 #| msgid ""
382 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
383 #| "set appropriately."
384 msgid ""
385 "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> is "
386 "set to indicate the error."
387 msgstr ""
388 "En caso de éxito se devuelve cero. En caso de error se devuelve -1, y "
389 "I<errno> se configura adecuadamente."
390
391 #. type: SH
392 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
393 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
394 #, no-wrap
395 msgid "ERRORS"
396 msgstr "ERRORES"
397
398 #. type: Plain text
399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
401 #, fuzzy
402 #| msgid "When B<shmat>() fails, I<errno> is set to one of the following:"
403 msgid "B<shmat>() can fail with one of the following errors:"
404 msgstr ""
405 "Cuando B<shmat>() falla I<errno> tiene uno de entre los siguientes valores:"
406
407 #. type: TP
408 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
409 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
410 #, no-wrap
411 msgid "B<EACCES>"
412 msgstr "B<EACCES>"
413
414 #. type: Plain text
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 msgid ""
418 "The calling process does not have the required permissions for the requested "
419 "attach type, and does not have the B<CAP_IPC_OWNER> capability in the user "
420 "namespace that governs its IPC namespace."
421 msgstr ""
422
423 #. type: TP
424 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
425 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
426 #, no-wrap
427 msgid "B<EIDRM>"
428 msgstr "B<EIDRM>"
429
430 #. type: Plain text
431 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
432 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
433 msgid "I<shmid> points to a removed identifier."
434 msgstr ""
435
436 #. type: TP
437 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
438 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
439 #, no-wrap
440 msgid "B<EINVAL>"
441 msgstr "B<EINVAL>"
442
443 #. type: Plain text
444 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
445 #: opensuse-tumbleweed
446 #, fuzzy
447 #| msgid ""
448 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
449 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
450 #| "B<brk>, or B<SHM_REMAP> was specified and I<shmaddr> was B<NULL>."
451 msgid ""
452 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
453 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
454 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
455 msgstr ""
456 "Valor de I<shmid> inválido, no alineado (i.e., sin alineamiento de página y "
457 "B<SHM_RND> no se especificó), o valor de I<shmaddr> inválido, o pegado "
458 "fallido en B<brk>, o se especificó B<SHM_REMAP> y I<shmaddr> era B<NULL>."
459
460 #. type: TP
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 #, no-wrap
464 msgid "B<ENOMEM>"
465 msgstr "B<ENOMEM>"
466
467 #. type: Plain text
468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
470 msgid "Could not allocate memory for the descriptor or for the page tables."
471 msgstr ""
472 "No se pudo reservar memoria para el descriptor o para las tablas de página."
473
474 #. type: Plain text
475 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
476 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
477 #, fuzzy
478 #| msgid "When B<shmat>() fails, I<errno> is set to one of the following:"
479 msgid "B<shmdt>() can fail with one of the following errors:"
480 msgstr ""
481 "Cuando B<shmat>() falla I<errno> tiene uno de entre los siguientes valores:"
482
483 #. The following since Linux 2.6.17-rc1:
484 #. type: Plain text
485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
487 msgid ""
488 "There is no shared memory segment attached at I<shmaddr>; or, I<shmaddr> is "
489 "not aligned on a page boundary."
490 msgstr ""
491
492 #. type: SH
493 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
494 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
495 #, no-wrap
496 msgid "STANDARDS"
497 msgstr "ESTÁNDARES"
498
499 #. type: Plain text
500 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
501 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
502 msgid "POSIX.1-2008."
503 msgstr "POSIX.1-2008."
504
505 #. type: SH
506 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
507 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
508 #, no-wrap
509 msgid "HISTORY"
510 msgstr "HISTORIAL"
511
512 #. SVr4 documents an additional error condition EMFILE.
513 #. type: Plain text
514 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
515 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
516 msgid "POSIX.1-2001, SVr4."
517 msgstr "POSIX.1-2001, SVr4."
518
519 #. type: Plain text
520 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
521 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
522 #, fuzzy
523 #| msgid ""
524 #| "SVr4, SVID. SVr4 documents an additional error condition EMFILE. In "
525 #| "SVID-v4 the type of the I<shmaddr> argument was changed from B<char *> "
526 #| "into B<const void *>, and the returned type of I<shmat>() from B<char *> "
527 #| "into B<void *>. (Linux libc4 and libc5 have the B<char *> prototypes; "
528 #| "glibc2 has B<void *>.)"
529 msgid ""
530 "In SVID 3 (or perhaps earlier), the type of the I<shmaddr> argument was "
531 "changed from I<char\\ *> into I<const void\\ *>, and the returned type of "
532 "B<shmat>() from I<char\\ *> into I<void\\ *>."
533 msgstr ""
534 "SVr4, SVID. SVr4 documenta una condición de error adicional EMFILE. En "
535 "SVID-v4, el tipo del argumento I<shmaddr> se cambió de B<char *> a B<const "
536 "void *>, y el tipo del valor devuelto por I<shmat>() de B<char *> a B<void "
537 "*>. (Linux libc4 y libc5 poseen los prototipos B<char *>. glibc2 posee "
538 "B<void *>.)"
539
540 #. type: Plain text
541 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
542 #: opensuse-tumbleweed
543 msgid ""
544 "POSIX.1-2024 changed the error code from I<(void\\ *)\\ -1> to B<SHM_FAILED>."
545 msgstr ""
546
547 #. type: SH
548 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
549 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
550 #, no-wrap
551 msgid "NOTES"
552 msgstr "NOTAS"
553
554 #. type: Plain text
555 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
556 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
557 msgid ""
558 "After a B<fork>(2), the child inherits the attached shared memory segments."
559 msgstr ""
560 "Después de un B<fork>() el hijo hereda los segmentos de memoria compartida "
561 "unidos."
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 msgid ""
567 "After an B<execve>(2), all attached shared memory segments are detached from "
568 "the process."
569 msgstr ""
570 "Tras un B<exec>() todos los segmentos de memoria compartida pegados son "
571 "despegados del proceso."
572
573 #. type: Plain text
574 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
575 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
576 msgid ""
577 "Upon B<_exit>(2), all attached shared memory segments are detached from the "
578 "process."
579 msgstr ""
580 "Tras B<_exit>() todos los segmentos de memoria compartida pegados son "
581 "despegados del proceso."
582
583 #. type: Plain text
584 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
585 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
586 msgid ""
587 "Using B<shmat>() with I<shmaddr> equal to NULL is the preferred, portable "
588 "way of attaching a shared memory segment. Be aware that the shared memory "
589 "segment attached in this way may be attached at different addresses in "
590 "different processes. Therefore, any pointers maintained within the shared "
591 "memory must be made relative (typically to the starting address of the "
592 "segment), rather than absolute."
593 msgstr ""
594 "Usar B<shmat>() con I<shmaddr> igual a NULL es la manera portable y "
595 "preferida de pegar un segmento de memoria compartida. Sea consciente de que "
596 "el segmento de memoria compartida pegado de esta manera puede ser pegado en "
597 "diferentes direcciones en diferentes procesos. Por consiguiente, cualquier "
598 "puntero mantenido dentro de la memoria compartida debe ser hecho relativo "
599 "(habitualmente a la dirección de comienzo del segmento), en lugar de "
600 "absoluto."
601
602 #. type: Plain text
603 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
604 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
605 msgid ""
606 "On Linux, it is possible to attach a shared memory segment even if it is "
607 "already marked to be deleted. However, POSIX.1 does not specify this "
608 "behavior and many other implementations do not support it."
609 msgstr ""
610
611 #. type: Plain text
612 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
613 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
614 msgid "The following system parameter affects B<shmat>():"
615 msgstr "El siguiente parámetro del sistema afecta a B<shmat>():"
616
617 #. type: TP
618 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
619 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
620 #, no-wrap
621 msgid "B<SHMLBA>"
622 msgstr "B<SHMLBA>"
623
624 #. type: Plain text
625 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
626 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
627 msgid ""
628 "Segment low boundary address multiple. When explicitly specifying an attach "
629 "address in a call to B<shmat>(), the caller should ensure that the address "
630 "is a multiple of this value. This is necessary on some architectures, in "
631 "order either to ensure good CPU cache performance or to ensure that "
632 "different attaches of the same segment have consistent views within the CPU "
633 "cache. B<SHMLBA> is normally some multiple of the system page size. (On "
634 "many Linux architectures, B<SHMLBA> is the same as the system page size.)"
635 msgstr ""
636
637 #. type: Plain text
638 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
639 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
640 #, fuzzy
641 #| msgid ""
642 #| "The implementation has no intrinsic limit to the per-process maximum "
643 #| "number of shared memory segments (B<SHMSEG>)."
644 msgid ""
645 "The implementation places no intrinsic per-process limit on the number of "
646 "shared memory segments (B<SHMSEG>)."
647 msgstr ""
648 "La implementación no tiene un límite intrínseco para el número máximo de "
649 "segmentos de memoria compartida por proceso (B<SHMSEG>)."
650
651 #. type: SH
652 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
653 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
654 #, no-wrap
655 msgid "EXAMPLES"
656 msgstr "EJEMPLOS"
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 "The two programs shown below exchange a string using a shared memory "
663 "segment. Further details about the programs are given below. First, we "
664 "show a shell session demonstrating their use."
665 msgstr ""
666
667 #. type: Plain text
668 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
669 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
670 msgid ""
671 "In one terminal window, we run the \"reader\" program, which creates a "
672 "System V shared memory segment and a System V semaphore set. The program "
673 "prints out the IDs of the created objects, and then waits for the semaphore "
674 "to change value."
675 msgstr ""
676
677 #. type: Plain text
678 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
679 #: opensuse-tumbleweed
680 #, fuzzy, no-wrap
681 #| msgid ""
682 #| "$ B<./svshm_string_read>\n"
683 #| "shmid = 1114194; semid = 15\n"
684 msgid ""
685 "$B< ./svshm_string_read>;\n"
686 "shmid = 1114194\n"
687 "semid = 15\n"
688 msgstr ""
689 "$ B<./svshm_string_read>\n"
690 "shmid = 1114194; semid = 15\n"
691
692 #. type: Plain text
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 msgid ""
696 "In another terminal window, we run the \"writer\" program. The \"writer\" "
697 "program takes three command-line arguments: the IDs of the shared memory "
698 "segment and semaphore set created by the \"reader\", and a string. It "
699 "attaches the existing shared memory segment, copies the string to the shared "
700 "memory, and modifies the semaphore value."
701 msgstr ""
702
703 #. type: Plain text
704 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
705 #: opensuse-tumbleweed
706 #, no-wrap
707 msgid "$B< ./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>;\n"
708 msgstr ""
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 "Returning to the terminal where the \"reader\" is running, we see that the "
715 "program has ceased waiting on the semaphore and has printed the string that "
716 "was copied into the shared memory segment by the writer:"
717 msgstr ""
718
719 #. type: Plain text
720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
722 #, no-wrap
723 msgid "Hello, world\n"
724 msgstr ""
725
726 #. type: SS
727 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
728 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
729 #, no-wrap
730 msgid "Program source: svshm_string.h"
731 msgstr ""
732
733 #. type: Plain text
734 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
735 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
736 msgid ""
737 "The following header file is included by the \"reader\" and \"writer\" "
738 "programs:"
739 msgstr ""
740
741 #. type: Plain text
742 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
743 #: opensuse-tumbleweed
744 #, no-wrap
745 msgid ""
746 "/* svshm_string.h\n"
747 "\\&\n"
748 " Licensed under GNU General Public License v2 or later.\n"
749 "*/\n"
750 "#ifndef SVSHM_STRING_H\n"
751 "#define SVSHM_STRING_H\n"
752 "\\&\n"
753 "#include E<lt>err.hE<gt>\n"
754 "#include E<lt>stdio.hE<gt>\n"
755 "#include E<lt>stdlib.hE<gt>\n"
756 "#include E<lt>sys/sem.hE<gt>\n"
757 "\\&\n"
758 "union semun { /* Used in calls to semctl() */\n"
759 " int val;\n"
760 " struct semid_ds *buf;\n"
761 " unsigned short *array;\n"
762 "#if defined(__linux__)\n"
763 " struct seminfo *__buf;\n"
764 "#endif\n"
765 "};\n"
766 "\\&\n"
767 "#define MEM_SIZE 4096\n"
768 "\\&\n"
769 "#endif // include guard\n"
770 msgstr ""
771
772 #. type: SS
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 #, no-wrap
776 msgid "Program source: svshm_string_read.c"
777 msgstr ""
778
779 #. type: Plain text
780 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
781 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
782 msgid ""
783 "The \"reader\" program creates a shared memory segment and a semaphore set "
784 "containing one semaphore. It then attaches the shared memory object into "
785 "its address space and initializes the semaphore value to 1. Finally, the "
786 "program waits for the semaphore value to become 0, and afterwards prints the "
787 "string that has been copied into the shared memory segment by the \"writer\"."
788 msgstr ""
789
790 #. type: Plain text
791 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
792 #: opensuse-tumbleweed
793 #, no-wrap
794 msgid ""
795 "/* svshm_string_read.c\n"
796 "\\&\n"
797 " Licensed under GNU General Public License v2 or later.\n"
798 "*/\n"
799 "#include E<lt>err.hE<gt>\n"
800 "#include E<lt>stdio.hE<gt>\n"
801 "#include E<lt>stdlib.hE<gt>\n"
802 "#include E<lt>sys/ipc.hE<gt>\n"
803 "#include E<lt>sys/sem.hE<gt>\n"
804 "#include E<lt>sys/shm.hE<gt>\n"
805 "\\&\n"
806 "#include \"svshm_string.h\"\n"
807 "\\&\n"
808 "int\n"
809 "main(void)\n"
810 "{\n"
811 " int semid, shmid;\n"
812 " char *addr;\n"
813 " union semun arg, dummy;\n"
814 " struct sembuf sop;\n"
815 "\\&\n"
816 " /* Create shared memory and semaphore set containing one\n"
817 " semaphore. */\n"
818 "\\&\n"
819 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
820 " if (shmid == -1)\n"
821 " err(EXIT_FAILURE, \"shmget\");\n"
822 "\\&\n"
823 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
824 " if (semid == -1)\n"
825 " err(EXIT_FAILURE, \"semget\");\n"
826 "\\&\n"
827 " /* Attach shared memory into our address space. */\n"
828 "\\&\n"
829 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
830 " if (addr == (void *) -1)\n"
831 " err(EXIT_FAILURE, \"shmat\");\n"
832 "\\&\n"
833 " /* Initialize semaphore 0 in set with value 1. */\n"
834 "\\&\n"
835 " arg.val = 1;\n"
836 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
837 " err(EXIT_FAILURE, \"semctl\");\n"
838 "\\&\n"
839 " printf(\"shmid = %d\\[rs]n\", shmid);\n"
840 " printf(\"semid = %d\\[rs]n\", semid);\n"
841 "\\&\n"
842 " /* Wait for semaphore value to become 0. */\n"
843 "\\&\n"
844 " sop.sem_num = 0;\n"
845 " sop.sem_op = 0;\n"
846 " sop.sem_flg = 0;\n"
847 "\\&\n"
848 " if (semop(semid, &sop, 1) == -1)\n"
849 " err(EXIT_FAILURE, \"semop\");\n"
850 "\\&\n"
851 " /* Print the string from shared memory. */\n"
852 "\\&\n"
853 " printf(\"%s\\[rs]n\", addr);\n"
854 "\\&\n"
855 " /* Remove shared memory and semaphore set. */\n"
856 "\\&\n"
857 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
858 " err(EXIT_FAILURE, \"shmctl\");\n"
859 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
860 " err(EXIT_FAILURE, \"semctl\");\n"
861 "\\&\n"
862 " exit(EXIT_SUCCESS);\n"
863 "}\n"
864 msgstr ""
865
866 #. type: SS
867 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
868 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
869 #, no-wrap
870 msgid "Program source: svshm_string_write.c"
871 msgstr ""
872
873 #. type: Plain text
874 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
875 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
876 msgid ""
877 "The writer program takes three command-line arguments: the IDs of the shared "
878 "memory segment and semaphore set that have already been created by the "
879 "\"reader\", and a string. It attaches the shared memory segment into its "
880 "address space, and then decrements the semaphore value to 0 in order to "
881 "inform the \"reader\" that it can now examine the contents of the shared "
882 "memory."
883 msgstr ""
884
885 #. type: Plain text
886 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
887 #: opensuse-tumbleweed
888 #, no-wrap
889 msgid ""
890 "/* svshm_string_write.c\n"
891 "\\&\n"
892 " Licensed under GNU General Public License v2 or later.\n"
893 "*/\n"
894 "#include E<lt>err.hE<gt>\n"
895 "#include E<lt>stdio.hE<gt>\n"
896 "#include E<lt>stdlib.hE<gt>\n"
897 "#include E<lt>string.hE<gt>\n"
898 "#include E<lt>sys/sem.hE<gt>\n"
899 "#include E<lt>sys/shm.hE<gt>\n"
900 "\\&\n"
901 "#include \"svshm_string.h\"\n"
902 "\\&\n"
903 "int\n"
904 "main(int argc, char *argv[])\n"
905 "{\n"
906 " int semid, shmid;\n"
907 " char *addr;\n"
908 " size_t size;\n"
909 " struct sembuf sop;\n"
910 "\\&\n"
911 " if (argc != 4) {\n"
912 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
913 " exit(EXIT_FAILURE);\n"
914 " }\n"
915 "\\&\n"
916 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
917 " if (size E<gt> MEM_SIZE) {\n"
918 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
919 " exit(EXIT_FAILURE);\n"
920 " }\n"
921 "\\&\n"
922 " /* Get object IDs from command-line. */\n"
923 "\\&\n"
924 " shmid = atoi(argv[1]);\n"
925 " semid = atoi(argv[2]);\n"
926 "\\&\n"
927 " /* Attach shared memory into our address space and copy string\n"
928 " (including trailing null byte) into memory. */\n"
929 "\\&\n"
930 " addr = shmat(shmid, NULL, 0);\n"
931 " if (addr == (void *) -1)\n"
932 " err(EXIT_FAILURE, \"shmat\");\n"
933 "\\&\n"
934 " memcpy(addr, argv[3], size);\n"
935 "\\&\n"
936 " /* Decrement semaphore to 0. */\n"
937 "\\&\n"
938 " sop.sem_num = 0;\n"
939 " sop.sem_op = -1;\n"
940 " sop.sem_flg = 0;\n"
941 "\\&\n"
942 " if (semop(semid, &sop, 1) == -1)\n"
943 " err(EXIT_FAILURE, \"semop\");\n"
944 "\\&\n"
945 " exit(EXIT_SUCCESS);\n"
946 "}\n"
947 msgstr ""
948
949 #. type: SH
950 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
951 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
952 #, no-wrap
953 msgid "SEE ALSO"
954 msgstr "VÉASE TAMBIÉN"
955
956 #. type: Plain text
957 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
958 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
959 msgid ""
960 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
961 "B<shm_overview>(7), B<sysvipc>(7)"
962 msgstr ""
963 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
964 "B<shm_overview>(7), B<sysvipc>(7)"
965
966 #. type: TH
967 #: debian-trixie
968 #, no-wrap
969 msgid "2024-06-15"
970 msgstr "15 Junio 2024"
971
972 #. type: TH
973 #: debian-trixie
974 #, no-wrap
975 msgid "Linux man-pages 6.9.1"
976 msgstr "Páginas de Manual de Linux 6.9.1"
977
978 #. type: Plain text
979 #: debian-trixie
980 msgid "Standard C library (I<libc>, I<-lc>)"
981 msgstr "Biblioteca Estándar C (I<libc>, I<-lc>)"
982
983 #. type: Plain text
984 #: debian-trixie fedora-44 fedora-rawhide
985 #, fuzzy
986 #| msgid ""
987 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
988 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
989 #| "B<brk>, or B<SHM_REMAP> was specified and I<shmaddr> was B<NULL>."
990 msgid ""
991 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
992 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
993 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
994 msgstr ""
995 "Valor de I<shmid> inválido, no alineado (i.e., sin alineamiento de página y "
996 "B<SHM_RND> no se especificó), o valor de I<shmaddr> inválido, o pegado "
997 "fallido en B<brk>, o se especificó B<SHM_REMAP> y I<shmaddr> era B<NULL>."
998
999 #. type: Plain text
1000 #: debian-trixie fedora-44 fedora-rawhide
1001 #, no-wrap
1002 msgid ""
1003 "$ B<./svshm_string_read>\n"
1004 "shmid = 1114194; semid = 15\n"
1005 msgstr ""
1006 "$ B<./svshm_string_read>\n"
1007 "shmid = 1114194; semid = 15\n"
1008
1009 #. type: Plain text
1010 #: debian-trixie fedora-44 fedora-rawhide
1011 #, no-wrap
1012 msgid "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
1013 msgstr ""
1014
1015 #. type: Plain text
1016 #: debian-trixie fedora-44 fedora-rawhide
1017 #, no-wrap
1018 msgid ""
1019 "/* svshm_string.h\n"
1020 "\\&\n"
1021 " Licensed under GNU General Public License v2 or later.\n"
1022 "*/\n"
1023 "#ifndef SVSHM_STRING_H\n"
1024 "#define SVSHM_STRING_H\n"
1025 "\\&\n"
1026 "#include E<lt>stdio.hE<gt>\n"
1027 "#include E<lt>stdlib.hE<gt>\n"
1028 "#include E<lt>sys/sem.hE<gt>\n"
1029 "\\&\n"
1030 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1031 " } while (0)\n"
1032 "\\&\n"
1033 "union semun { /* Used in calls to semctl() */\n"
1034 " int val;\n"
1035 " struct semid_ds *buf;\n"
1036 " unsigned short *array;\n"
1037 "#if defined(__linux__)\n"
1038 " struct seminfo *__buf;\n"
1039 "#endif\n"
1040 "};\n"
1041 "\\&\n"
1042 "#define MEM_SIZE 4096\n"
1043 "\\&\n"
1044 "#endif // include guard\n"
1045 msgstr ""
1046
1047 #. type: Plain text
1048 #: debian-trixie fedora-44 fedora-rawhide
1049 #, no-wrap
1050 msgid ""
1051 "/* svshm_string_read.c\n"
1052 "\\&\n"
1053 " Licensed under GNU General Public License v2 or later.\n"
1054 "*/\n"
1055 "#include E<lt>stdio.hE<gt>\n"
1056 "#include E<lt>stdlib.hE<gt>\n"
1057 "#include E<lt>sys/ipc.hE<gt>\n"
1058 "#include E<lt>sys/sem.hE<gt>\n"
1059 "#include E<lt>sys/shm.hE<gt>\n"
1060 "\\&\n"
1061 "#include \"svshm_string.h\"\n"
1062 "\\&\n"
1063 "int\n"
1064 "main(void)\n"
1065 "{\n"
1066 " int semid, shmid;\n"
1067 " char *addr;\n"
1068 " union semun arg, dummy;\n"
1069 " struct sembuf sop;\n"
1070 "\\&\n"
1071 " /* Create shared memory and semaphore set containing one\n"
1072 " semaphore. */\n"
1073 "\\&\n"
1074 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
1075 " if (shmid == -1)\n"
1076 " errExit(\"shmget\");\n"
1077 "\\&\n"
1078 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
1079 " if (semid == -1)\n"
1080 " errExit(\"semget\");\n"
1081 "\\&\n"
1082 " /* Attach shared memory into our address space. */\n"
1083 "\\&\n"
1084 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
1085 " if (addr == (void *) -1)\n"
1086 " errExit(\"shmat\");\n"
1087 "\\&\n"
1088 " /* Initialize semaphore 0 in set with value 1. */\n"
1089 "\\&\n"
1090 " arg.val = 1;\n"
1091 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
1092 " errExit(\"semctl\");\n"
1093 "\\&\n"
1094 " printf(\"shmid = %d; semid = %d\\[rs]n\", shmid, semid);\n"
1095 "\\&\n"
1096 " /* Wait for semaphore value to become 0. */\n"
1097 "\\&\n"
1098 " sop.sem_num = 0;\n"
1099 " sop.sem_op = 0;\n"
1100 " sop.sem_flg = 0;\n"
1101 "\\&\n"
1102 " if (semop(semid, &sop, 1) == -1)\n"
1103 " errExit(\"semop\");\n"
1104 "\\&\n"
1105 " /* Print the string from shared memory. */\n"
1106 "\\&\n"
1107 " printf(\"%s\\[rs]n\", addr);\n"
1108 "\\&\n"
1109 " /* Remove shared memory and semaphore set. */\n"
1110 "\\&\n"
1111 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
1112 " errExit(\"shmctl\");\n"
1113 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
1114 " errExit(\"semctl\");\n"
1115 "\\&\n"
1116 " exit(EXIT_SUCCESS);\n"
1117 "}\n"
1118 msgstr ""
1119
1120 #. type: Plain text
1121 #: debian-trixie
1122 #, no-wrap
1123 msgid ""
1124 "/* svshm_string_write.c\n"
1125 "\\&\n"
1126 " Licensed under GNU General Public License v2 or later.\n"
1127 "*/\n"
1128 "#include E<lt>stdio.hE<gt>\n"
1129 "#include E<lt>stdlib.hE<gt>\n"
1130 "#include E<lt>string.hE<gt>\n"
1131 "#include E<lt>sys/sem.hE<gt>\n"
1132 "#include E<lt>sys/shm.hE<gt>\n"
1133 "\\&\n"
1134 "#include \"svshm_string.h\"\n"
1135 "\\&\n"
1136 "int\n"
1137 "main(int argc, char *argv[])\n"
1138 "{\n"
1139 " int semid, shmid;\n"
1140 " char *addr;\n"
1141 " size_t len;\n"
1142 " struct sembuf sop;\n"
1143 "\\&\n"
1144 " if (argc != 4) {\n"
1145 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1146 " exit(EXIT_FAILURE);\n"
1147 " }\n"
1148 "\\&\n"
1149 " len = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1150 " if (len E<gt> MEM_SIZE) {\n"
1151 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1152 " exit(EXIT_FAILURE);\n"
1153 " }\n"
1154 "\\&\n"
1155 " /* Get object IDs from command-line. */\n"
1156 "\\&\n"
1157 " shmid = atoi(argv[1]);\n"
1158 " semid = atoi(argv[2]);\n"
1159 "\\&\n"
1160 " /* Attach shared memory into our address space and copy string\n"
1161 " (including trailing null byte) into memory. */\n"
1162 "\\&\n"
1163 " addr = shmat(shmid, NULL, 0);\n"
1164 " if (addr == (void *) -1)\n"
1165 " errExit(\"shmat\");\n"
1166 "\\&\n"
1167 " memcpy(addr, argv[3], len);\n"
1168 "\\&\n"
1169 " /* Decrement semaphore to 0. */\n"
1170 "\\&\n"
1171 " sop.sem_num = 0;\n"
1172 " sop.sem_op = -1;\n"
1173 " sop.sem_flg = 0;\n"
1174 "\\&\n"
1175 " if (semop(semid, &sop, 1) == -1)\n"
1176 " errExit(\"semop\");\n"
1177 "\\&\n"
1178 " exit(EXIT_SUCCESS);\n"
1179 "}\n"
1180 msgstr ""
1181
1182 #. type: TH
1183 #: fedora-44 fedora-rawhide
1184 #, no-wrap
1185 msgid "2024-11-17"
1186 msgstr "17 Noviembre 2024"
1187
1188 #. type: TH
1189 #: fedora-44 fedora-rawhide
1190 #, no-wrap
1191 msgid "Linux man-pages 6.13"
1192 msgstr "Páginas de Manual de Linux 6.13"
1193
1194 #. type: Plain text
1195 #: fedora-44 fedora-rawhide
1196 #, no-wrap
1197 msgid ""
1198 "/* svshm_string_write.c\n"
1199 "\\&\n"
1200 " Licensed under GNU General Public License v2 or later.\n"
1201 "*/\n"
1202 "#include E<lt>stdio.hE<gt>\n"
1203 "#include E<lt>stdlib.hE<gt>\n"
1204 "#include E<lt>string.hE<gt>\n"
1205 "#include E<lt>sys/sem.hE<gt>\n"
1206 "#include E<lt>sys/shm.hE<gt>\n"
1207 "\\&\n"
1208 "#include \"svshm_string.h\"\n"
1209 "\\&\n"
1210 "int\n"
1211 "main(int argc, char *argv[])\n"
1212 "{\n"
1213 " int semid, shmid;\n"
1214 " char *addr;\n"
1215 " size_t size;\n"
1216 " struct sembuf sop;\n"
1217 "\\&\n"
1218 " if (argc != 4) {\n"
1219 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1220 " exit(EXIT_FAILURE);\n"
1221 " }\n"
1222 "\\&\n"
1223 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1224 " if (size E<gt> MEM_SIZE) {\n"
1225 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1226 " exit(EXIT_FAILURE);\n"
1227 " }\n"
1228 "\\&\n"
1229 " /* Get object IDs from command-line. */\n"
1230 "\\&\n"
1231 " shmid = atoi(argv[1]);\n"
1232 " semid = atoi(argv[2]);\n"
1233 "\\&\n"
1234 " /* Attach shared memory into our address space and copy string\n"
1235 " (including trailing null byte) into memory. */\n"
1236 "\\&\n"
1237 " addr = shmat(shmid, NULL, 0);\n"
1238 " if (addr == (void *) -1)\n"
1239 " errExit(\"shmat\");\n"
1240 "\\&\n"
1241 " memcpy(addr, argv[3], size);\n"
1242 "\\&\n"
1243 " /* Decrement semaphore to 0. */\n"
1244 "\\&\n"
1245 " sop.sem_num = 0;\n"
1246 " sop.sem_op = -1;\n"
1247 " sop.sem_flg = 0;\n"
1248 "\\&\n"
1249 " if (semop(semid, &sop, 1) == -1)\n"
1250 " errExit(\"semop\");\n"
1251 "\\&\n"
1252 " exit(EXIT_SUCCESS);\n"
1253 "}\n"
1254 msgstr ""
1255
1256 #. type: TH
1257 #: mageia-cauldron
1258 #, no-wrap
1259 msgid "Linux man-pages 6.17"
1260 msgstr "Páginas de Manual de Linux 6.17"
1261
1262 #. type: TH
1263 #: opensuse-leap-16-1 opensuse-tumbleweed
1264 #, no-wrap
1265 msgid "Linux man-pages (unreleased)"
1266 msgstr "Páginas de Manual de Linux (no publicadas)"