Debian Codegraph @

po/pt_BR/man2/shmop.2.po

raw
1 # Brazilian Portuguese translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Orlando V. de Castro Jr. <[email protected]>, 2001.
5 # André Luiz Fassone <[email protected]>, 2001.
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: manpages-l10n\n"
9 "POT-Creation-Date: 2026-06-05 06:43+0200\n"
10 "PO-Revision-Date: 2001-06-02 19:20-0300\n"
11 "Last-Translator: André Luiz Fassone <[email protected]>\n"
12 "Language-Team: Brazilian Portuguese <debian-l10n-"
13 "[email protected]>\n"
14 "Language: pt_BR\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: Virtaal 1.0.0-beta1\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 fevereiro 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 "Linux man-pages 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 "NOME"
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 - operações com memória compartilhada (shared memory operations)"
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 C Padrão (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 "SINOPSE"
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 "DESCRIÇÃO"
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 data segment 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 "A função B<shmat> anexa o segmento de memória compartilhada identificado por "
122 "B<shmid> ao segmento de dados do processo que fez a chamada da função. O "
123 "endereço a ser anexado é especificado por I<shmaddr> com um dos seguintes "
124 "critérios:"
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 msgid ""
137 "If I<shmaddr> is NULL, the system chooses a suitable (unused) page-aligned "
138 "address to attach the segment."
139 msgstr ""
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 #, fuzzy
145 #| msgid ""
146 #| "If I<shmaddr> isn't B<0> and B<SHM_RND> is asserted in I<shmflg>, the "
147 #| "attach occurs at address equal to the rounding down of I<shmaddr> to a "
148 #| "multiple of B<SHMLBA>. Otherwise I<shmaddr> must be a page aligned "
149 #| "address at which the attach occurs."
150 msgid ""
151 "If I<shmaddr> isn't NULL and B<SHM_RND> is specified in I<shmflg>, the "
152 "attach occurs at the address equal to I<shmaddr> rounded down to the nearest "
153 "multiple of B<SHMLBA>."
154 msgstr ""
155 "Se I<shmaddr> não for B<0> e B<SHM_RND> é afirmado em I<shmflg>, a anexação "
156 "ocorre no endereço igual ao arredondamento para menor de I<shmaddr> até um "
157 "múltiplo de B<SHMLBA>. De outra forma I<shmaddr> deve ser uma página de "
158 "endereço alinhada na qual a anexação ocorre."
159
160 #. type: Plain text
161 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
162 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
163 msgid ""
164 "Otherwise, I<shmaddr> must be a page-aligned address at which the attach "
165 "occurs."
166 msgstr ""
167
168 #. type: Plain text
169 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
170 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
171 msgid ""
172 "In addition to B<SHM_RND>, the following flags may be specified in the "
173 "I<shmflg> bit-mask argument:"
174 msgstr ""
175
176 #. type: TP
177 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
178 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
179 #, no-wrap
180 msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
181 msgstr ""
182
183 #. type: Plain text
184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
186 msgid ""
187 "Allow the contents of the segment to be executed. The caller must have "
188 "execute permission on the segment."
189 msgstr ""
190
191 #. type: TP
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 #, no-wrap
195 msgid "B<SHM_RDONLY>"
196 msgstr "B<SHM_RDONLY>"
197
198 #. type: Plain text
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 #, fuzzy
202 #| msgid ""
203 #| "If B<SHM_RDONLY> is asserted in I<shmflg>, the segment is attached for "
204 #| "reading and the process must have read access permissions to the "
205 #| "segment. Otherwise the segment is attached for read and write and the "
206 #| "process must have read and write access permissions to the segment. "
207 #| "There is no notion of write-only shared memory segment."
208 msgid ""
209 "Attach the segment for read-only access. The process must have read "
210 "permission for the segment. If this flag is not specified, the segment is "
211 "attached for read and write access, and the process must have read and write "
212 "permission for the segment. There is no notion of a write-only shared "
213 "memory segment."
214 msgstr ""
215 "Se B<SHM_RDONLY> é afirmado em I<shmflg>, o segmento é anexado para leitura "
216 "e o processo deve possuir permissão de acesso para leitura do segmento. De "
217 "outra forma o segmento é anexado para leitura e escrita e o processo deve "
218 "possuir permissões para ler e gravar no segmento. Não existe a noção de "
219 "apenas gravação em segmento de memória compartilhada."
220
221 #. type: TP
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 #, no-wrap
225 msgid "B<SHM_REMAP> (Linux-specific)"
226 msgstr ""
227
228 #. type: Plain text
229 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
230 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
231 msgid ""
232 "This flag specifies that the mapping of the segment should replace any "
233 "existing mapping in the range starting at I<shmaddr> and continuing for the "
234 "size of the segment. (Normally, an B<EINVAL> error would result if a "
235 "mapping already exists in this address range.) In this case, I<shmaddr> "
236 "must not be NULL."
237 msgstr ""
238
239 #. type: Plain text
240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
242 msgid ""
243 "The B<brk>(2) value of the calling process is not altered by the attach. "
244 "The segment will automatically be detached at process exit. The same "
245 "segment may be attached as a read and as a read-write one, and more than "
246 "once, in the process's address space."
247 msgstr ""
248 "O valor B<brk>() do processo que fez a chamada não é alterado pelo anexo. O "
249 "segmento será automaticamente desanexado na saída do processo. O mesmo "
250 "segmento pode ser anexado como para leitura e como para leitura e gravação "
251 "uma, ou mais vezes, no espaço de endereço do processo."
252
253 #. type: Plain text
254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
256 #, fuzzy
257 #| msgid ""
258 #| "On a successful B<shmat> call the system updates the members of the "
259 #| "structure B<shmid_ds> associated to the shared memory segment as follows:"
260 msgid ""
261 "A successful B<shmat>() call updates the members of the I<shmid_ds> "
262 "structure (see B<shmctl>(2)) associated with the shared memory segment as "
263 "follows:"
264 msgstr ""
265 "A uma chamada bem sucedida a B<shmat> o sistema atualiza os membros da "
266 "estrutra B<shmid_ds> associada ao segmento de memória compartilhada como se "
267 "segue:"
268
269 #. type: Plain text
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 msgid "I<shm_atime> is set to the current time."
273 msgstr "I<shm_atime> é definido com o tempo atual."
274
275 #. type: Plain text
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 msgid "I<shm_lpid> is set to the process-ID of the calling process."
279 msgstr "I<shm_lpid> é selecionado para o PID do processo solicitante."
280
281 #. type: Plain text
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 msgid "I<shm_nattch> is incremented by one."
285 msgstr "I<shm_nattch> é incrementado uma vez."
286
287 #. type: SS
288 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
289 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
290 #, no-wrap
291 msgid "shmdt()"
292 msgstr "shmdt()"
293
294 #. type: Plain text
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 #, fuzzy
298 #| msgid ""
299 #| "The function B<shmdt> detaches from the calling process's data segment "
300 #| "the shared memory segment located at the address specified by "
301 #| "I<shmaddr>. The detaching shared memory segment must be one among the "
302 #| "currently attached ones (to the process's address space) with I<shmaddr> "
303 #| "equal to the value returned by the its attaching B<shmat> call."
304 msgid ""
305 "B<shmdt>() detaches the shared memory segment located at the address "
306 "specified by I<shmaddr> from the address space of the calling process. The "
307 "to-be-detached segment must be currently attached with I<shmaddr> equal to "
308 "the value returned by the attaching B<shmat>() call."
309 msgstr ""
310 "A função B<shmdt> separa do segmento de dados do processo que fez a chamada "
311 "o segmento de memoria compartilhada localizada no endereço especificado por "
312 "I<shmaddr>. O segmento de memória compartilhada separado deve ser dentre os "
313 "correntemente anexados (ao espaço do endereço do processo) com I<shmaddr> "
314 "igual ao valor retornado pelo sua chamada anexadora B<shmat>."
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 #, fuzzy
320 #| msgid ""
321 #| "On a successful B<shmdt> call the system updates the members of the "
322 #| "structure B<shmid_ds> associated to the shared memory segment as follows:"
323 msgid ""
324 "On a successful B<shmdt>() call, the system updates the members of the "
325 "I<shmid_ds> structure associated with the shared memory segment as follows:"
326 msgstr ""
327 "A uma chamada bem sucedida a B<shmdt> o sistema atualiza os membros da "
328 "estrutra B<shmid_ds> associada ao segmento de memória compartilhada como se "
329 "segue:"
330
331 #. type: Plain text
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 msgid "I<shm_dtime> is set to the current time."
335 msgstr "I<shm_dtime> é definido com o tempo atual."
336
337 #. type: Plain text
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 msgid ""
341 "I<shm_nattch> is decremented by one. If it becomes 0 and the segment is "
342 "marked for deletion, the segment is deleted."
343 msgstr ""
344 "I<shm_nattch> é decrementado em um. Se o valor chegar a 0 e o segmento está "
345 "marcado para ser apagado, o segmento é apagado."
346
347 #. type: SH
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 #, no-wrap
351 msgid "RETURN VALUE"
352 msgstr "VALOR DE RETORNO"
353
354 #. type: Plain text
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 #, fuzzy
358 #| msgid ""
359 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
360 #| "set appropriately."
361 msgid ""
362 "On success, B<shmat>() returns the address of the attached shared memory "
363 "segment; on error, I<(void\\ *)\\ -1> is returned, and I<errno> is set to "
364 "indicate the error."
365 msgstr ""
366 "Em caso de sucesso, zero é retornado. Caso contrário, -1 é retornado, e "
367 "I<errno> é selecionado adequadamente."
368
369 #. type: Plain text
370 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
371 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
372 #, fuzzy
373 #| msgid ""
374 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
375 #| "set appropriately."
376 msgid ""
377 "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> is "
378 "set to indicate the error."
379 msgstr ""
380 "Em caso de sucesso, zero é retornado. Caso contrário, -1 é retornado, e "
381 "I<errno> é selecionado adequadamente."
382
383 #. type: SH
384 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
385 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
386 #, no-wrap
387 msgid "ERRORS"
388 msgstr "ERROS"
389
390 #. type: Plain text
391 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
392 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
393 #, fuzzy
394 #| msgid ""
395 #| "When B<shmat> fails, at return B<errno> will be set to one among the "
396 #| "following values:"
397 msgid "B<shmat>() can fail with one of the following errors:"
398 msgstr ""
399 "Quando B<shmat> falha, no retorno B<errno> será setado para um dos seguintes "
400 "valores:"
401
402 #. type: TP
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 #, no-wrap
406 msgid "B<EACCES>"
407 msgstr "B<EACCES>"
408
409 #. type: Plain text
410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
412 msgid ""
413 "The calling process does not have the required permissions for the requested "
414 "attach type, and does not have the B<CAP_IPC_OWNER> capability in the user "
415 "namespace that governs its IPC namespace."
416 msgstr ""
417
418 #. type: TP
419 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
420 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
421 #, no-wrap
422 msgid "B<EIDRM>"
423 msgstr "B<EIDRM>"
424
425 #. type: Plain text
426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
428 msgid "I<shmid> points to a removed identifier."
429 msgstr "I<shmid> aponta para um identificador removido."
430
431 #. type: TP
432 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
433 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
434 #, no-wrap
435 msgid "B<EINVAL>"
436 msgstr "B<EINVAL>"
437
438 #. type: Plain text
439 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
440 #: opensuse-tumbleweed
441 #, fuzzy
442 #| msgid ""
443 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
444 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
445 #| "B<brk>."
446 msgid ""
447 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
448 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
449 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
450 msgstr ""
451 "Valor I<shmid> inválido, desalinhado (isto é, sem alinhamento de página e "
452 "B<SHM_RND> não foi especificado) ou valor I<shmaddr> inválido, ou falhando "
453 "em anexar em B<brk>."
454
455 #. type: TP
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 #, no-wrap
459 msgid "B<ENOMEM>"
460 msgstr "B<ENOMEM>"
461
462 #. type: Plain text
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 msgid "Could not allocate memory for the descriptor or for the page tables."
466 msgstr ""
467 "Não foi possível alocar memória para o descritor ou para as tabelas de "
468 "página."
469
470 #. type: Plain text
471 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
472 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
473 #, fuzzy
474 #| msgid ""
475 #| "When B<shmat> fails, at return B<errno> will be set to one among the "
476 #| "following values:"
477 msgid "B<shmdt>() can fail with one of the following errors:"
478 msgstr ""
479 "Quando B<shmat> falha, no retorno B<errno> será setado para um dos seguintes "
480 "valores:"
481
482 #. The following since Linux 2.6.17-rc1:
483 #. type: Plain text
484 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
485 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
486 msgid ""
487 "There is no shared memory segment attached at I<shmaddr>; or, I<shmaddr> is "
488 "not aligned on a page boundary."
489 msgstr ""
490
491 #. type: SH
492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
494 #, no-wrap
495 msgid "STANDARDS"
496 msgstr "PADRÕES"
497
498 #. type: Plain text
499 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
500 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
501 msgid "POSIX.1-2008."
502 msgstr "POSIX.1-2008."
503
504 #. type: SH
505 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
506 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
507 #, no-wrap
508 msgid "HISTORY"
509 msgstr "HISTÓRICO"
510
511 #. SVr4 documents an additional error condition EMFILE.
512 #. type: Plain text
513 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
514 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
515 msgid "POSIX.1-2001, SVr4."
516 msgstr "POSIX.1-2001, SVr4."
517
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 #, fuzzy
522 #| msgid ""
523 #| "SVr4, SVID. SVr4 documents an additional error condition EMFILE. In "
524 #| "SVID-v4 the type of the I<shmaddr> argument was changed from B<char *> "
525 #| "into B<const void *>, and the returned type of I<shmat>() from B<char *> "
526 #| "into B<void *>. (Linux libc4 and libc5 have the B<char *> prototypes; "
527 #| "glibc2 has B<void *>.)"
528 msgid ""
529 "In SVID 3 (or perhaps earlier), the type of the I<shmaddr> argument was "
530 "changed from I<char\\ *> into I<const void\\ *>, and the returned type of "
531 "B<shmat>() from I<char\\ *> into I<void\\ *>."
532 msgstr ""
533 "SVr4, SVID. A SVr4 documenta uma condição de erro adicional EMFILE. Na SVID-"
534 "v4 o tipo do argumento I<shmaddr> foi mudado de B<char *> para B<const void "
535 "*>, e o tipo retornado por I<shmat>() de B<char *> para B<void *>. (Linux "
536 "libc4 e libc5 têm os tipos primitivos B<char *>; a glibc2 tem B<void *>.)"
537
538 #. type: Plain text
539 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
540 #: opensuse-tumbleweed
541 msgid ""
542 "POSIX.1-2024 changed the error code from I<(void\\ *)\\ -1> to B<SHM_FAILED>."
543 msgstr ""
544
545 #. type: SH
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 #, no-wrap
549 msgid "NOTES"
550 msgstr "NOTAS"
551
552 #. type: Plain text
553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
555 msgid ""
556 "After a B<fork>(2), the child inherits the attached shared memory segments."
557 msgstr ""
558 "Depois de B<fork>(2) o filho herda os segmentos de memória compartilhada "
559 "anexados."
560
561 #. type: Plain text
562 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
563 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
564 #, fuzzy
565 #| msgid ""
566 #| "After an B<exec()> all attached shared memory segments are detached (not "
567 #| "destroyed)."
568 msgid ""
569 "After an B<execve>(2), all attached shared memory segments are detached from "
570 "the process."
571 msgstr ""
572 "Depois de B<exec()> todos segmentos de memória compartilhada anexados serão "
573 "liberados (não destruídos)."
574
575 #. type: Plain text
576 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
577 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
578 #, fuzzy
579 #| msgid ""
580 #| "Upon B<exit()> all attached shared memory segments are detached (not "
581 #| "destroyed)."
582 msgid ""
583 "Upon B<_exit>(2), all attached shared memory segments are detached from the "
584 "process."
585 msgstr ""
586 "Em um B<exit()> todos segmentos de memória compartilhada anexados serão "
587 "liberados (não destruídos)."
588
589 #. type: Plain text
590 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
591 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
592 msgid ""
593 "Using B<shmat>() with I<shmaddr> equal to NULL is the preferred, portable "
594 "way of attaching a shared memory segment. Be aware that the shared memory "
595 "segment attached in this way may be attached at different addresses in "
596 "different processes. Therefore, any pointers maintained within the shared "
597 "memory must be made relative (typically to the starting address of the "
598 "segment), rather than absolute."
599 msgstr ""
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 "On Linux, it is possible to attach a shared memory segment even if it is "
606 "already marked to be deleted. However, POSIX.1 does not specify this "
607 "behavior and many other implementations do not support it."
608 msgstr ""
609
610 #. type: Plain text
611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
613 #, fuzzy
614 #| msgid ""
615 #| "The following is a system parameter affecting a B<shmat> system call:"
616 msgid "The following system parameter affects B<shmat>():"
617 msgstr ""
618 "O que segue são os parâmetros do sistema afetando a chamada de sistema "
619 "B<shmat>:"
620
621 #. type: TP
622 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
623 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
624 #, no-wrap
625 msgid "B<SHMLBA>"
626 msgstr "B<SHMLBA>"
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 msgid ""
632 "Segment low boundary address multiple. When explicitly specifying an attach "
633 "address in a call to B<shmat>(), the caller should ensure that the address "
634 "is a multiple of this value. This is necessary on some architectures, in "
635 "order either to ensure good CPU cache performance or to ensure that "
636 "different attaches of the same segment have consistent views within the CPU "
637 "cache. B<SHMLBA> is normally some multiple of the system page size. (On "
638 "many Linux architectures, B<SHMLBA> is the same as the system page size.)"
639 msgstr ""
640
641 #. type: Plain text
642 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
643 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
644 #, fuzzy
645 #| msgid ""
646 #| "The implementation has no intrinsic limit to the per process maximum "
647 #| "number of shared memory segments (B<SHMSEG>)"
648 msgid ""
649 "The implementation places no intrinsic per-process limit on the number of "
650 "shared memory segments (B<SHMSEG>)."
651 msgstr ""
652 "A implementação não tem limite intrínseco para o número máximo de segmentos "
653 "de memória compartilhada por processo (B<SHMSEG>)"
654
655 #. type: SH
656 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
657 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
658 #, no-wrap
659 msgid "EXAMPLES"
660 msgstr "EXEMPLOS"
661
662 #. type: Plain text
663 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
664 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
665 msgid ""
666 "The two programs shown below exchange a string using a shared memory "
667 "segment. Further details about the programs are given below. First, we "
668 "show a shell session demonstrating their use."
669 msgstr ""
670
671 #. type: Plain text
672 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
673 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
674 msgid ""
675 "In one terminal window, we run the \"reader\" program, which creates a "
676 "System V shared memory segment and a System V semaphore set. The program "
677 "prints out the IDs of the created objects, and then waits for the semaphore "
678 "to change value."
679 msgstr ""
680
681 #. type: Plain text
682 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
683 #: opensuse-tumbleweed
684 #, fuzzy, no-wrap
685 #| msgid ""
686 #| "$ B<./svshm_string_read >\n"
687 #| "shmid = 1114194; semid = 15\n"
688 msgid ""
689 "$B< ./svshm_string_read>;\n"
690 "shmid = 1114194\n"
691 "semid = 15\n"
692 msgstr ""
693 "$ B<./svshm_string_read >\n"
694 "shmid = 1114194; semid = 15\n"
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 msgid ""
700 "In another terminal window, we run the \"writer\" program. The \"writer\" "
701 "program takes three command-line arguments: the IDs of the shared memory "
702 "segment and semaphore set created by the \"reader\", and a string. It "
703 "attaches the existing shared memory segment, copies the string to the shared "
704 "memory, and modifies the semaphore value."
705 msgstr ""
706
707 #. type: Plain text
708 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
709 #: opensuse-tumbleweed
710 #, fuzzy, no-wrap
711 #| msgid "$ B<./svshm_string_write 1114194 15 \\(aqHello, world\\(aq>\n"
712 msgid "$B< ./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>;\n"
713 msgstr "$ B<./svshm_string_write 1114194 15 \\(aqHello, world\\(aq>\n"
714
715 #. type: Plain text
716 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
717 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
718 msgid ""
719 "Returning to the terminal where the \"reader\" is running, we see that the "
720 "program has ceased waiting on the semaphore and has printed the string that "
721 "was copied into the shared memory segment by the writer:"
722 msgstr ""
723
724 #. type: Plain text
725 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
726 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
727 #, no-wrap
728 msgid "Hello, world\n"
729 msgstr "Hello, world\n"
730
731 #. type: SS
732 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
733 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
734 #, no-wrap
735 msgid "Program source: svshm_string.h"
736 msgstr ""
737
738 #. type: Plain text
739 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
740 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
741 msgid ""
742 "The following header file is included by the \"reader\" and \"writer\" "
743 "programs:"
744 msgstr ""
745
746 #. type: Plain text
747 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
748 #: opensuse-tumbleweed
749 #, no-wrap
750 msgid ""
751 "/* svshm_string.h\n"
752 "\\&\n"
753 " Licensed under GNU General Public License v2 or later.\n"
754 "*/\n"
755 "#ifndef SVSHM_STRING_H\n"
756 "#define SVSHM_STRING_H\n"
757 "\\&\n"
758 "#include E<lt>err.hE<gt>\n"
759 "#include E<lt>stdio.hE<gt>\n"
760 "#include E<lt>stdlib.hE<gt>\n"
761 "#include E<lt>sys/sem.hE<gt>\n"
762 "\\&\n"
763 "union semun { /* Used in calls to semctl() */\n"
764 " int val;\n"
765 " struct semid_ds *buf;\n"
766 " unsigned short *array;\n"
767 "#if defined(__linux__)\n"
768 " struct seminfo *__buf;\n"
769 "#endif\n"
770 "};\n"
771 "\\&\n"
772 "#define MEM_SIZE 4096\n"
773 "\\&\n"
774 "#endif // include guard\n"
775 msgstr ""
776
777 #. type: SS
778 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
779 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
780 #, no-wrap
781 msgid "Program source: svshm_string_read.c"
782 msgstr ""
783
784 #. type: Plain text
785 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
786 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
787 msgid ""
788 "The \"reader\" program creates a shared memory segment and a semaphore set "
789 "containing one semaphore. It then attaches the shared memory object into "
790 "its address space and initializes the semaphore value to 1. Finally, the "
791 "program waits for the semaphore value to become 0, and afterwards prints the "
792 "string that has been copied into the shared memory segment by the \"writer\"."
793 msgstr ""
794
795 #. type: Plain text
796 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
797 #: opensuse-tumbleweed
798 #, no-wrap
799 msgid ""
800 "/* svshm_string_read.c\n"
801 "\\&\n"
802 " Licensed under GNU General Public License v2 or later.\n"
803 "*/\n"
804 "#include E<lt>err.hE<gt>\n"
805 "#include E<lt>stdio.hE<gt>\n"
806 "#include E<lt>stdlib.hE<gt>\n"
807 "#include E<lt>sys/ipc.hE<gt>\n"
808 "#include E<lt>sys/sem.hE<gt>\n"
809 "#include E<lt>sys/shm.hE<gt>\n"
810 "\\&\n"
811 "#include \"svshm_string.h\"\n"
812 "\\&\n"
813 "int\n"
814 "main(void)\n"
815 "{\n"
816 " int semid, shmid;\n"
817 " char *addr;\n"
818 " union semun arg, dummy;\n"
819 " struct sembuf sop;\n"
820 "\\&\n"
821 " /* Create shared memory and semaphore set containing one\n"
822 " semaphore. */\n"
823 "\\&\n"
824 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
825 " if (shmid == -1)\n"
826 " err(EXIT_FAILURE, \"shmget\");\n"
827 "\\&\n"
828 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
829 " if (semid == -1)\n"
830 " err(EXIT_FAILURE, \"semget\");\n"
831 "\\&\n"
832 " /* Attach shared memory into our address space. */\n"
833 "\\&\n"
834 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
835 " if (addr == (void *) -1)\n"
836 " err(EXIT_FAILURE, \"shmat\");\n"
837 "\\&\n"
838 " /* Initialize semaphore 0 in set with value 1. */\n"
839 "\\&\n"
840 " arg.val = 1;\n"
841 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
842 " err(EXIT_FAILURE, \"semctl\");\n"
843 "\\&\n"
844 " printf(\"shmid = %d\\[rs]n\", shmid);\n"
845 " printf(\"semid = %d\\[rs]n\", semid);\n"
846 "\\&\n"
847 " /* Wait for semaphore value to become 0. */\n"
848 "\\&\n"
849 " sop.sem_num = 0;\n"
850 " sop.sem_op = 0;\n"
851 " sop.sem_flg = 0;\n"
852 "\\&\n"
853 " if (semop(semid, &sop, 1) == -1)\n"
854 " err(EXIT_FAILURE, \"semop\");\n"
855 "\\&\n"
856 " /* Print the string from shared memory. */\n"
857 "\\&\n"
858 " printf(\"%s\\[rs]n\", addr);\n"
859 "\\&\n"
860 " /* Remove shared memory and semaphore set. */\n"
861 "\\&\n"
862 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
863 " err(EXIT_FAILURE, \"shmctl\");\n"
864 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
865 " err(EXIT_FAILURE, \"semctl\");\n"
866 "\\&\n"
867 " exit(EXIT_SUCCESS);\n"
868 "}\n"
869 msgstr ""
870
871 #. type: SS
872 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
873 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
874 #, no-wrap
875 msgid "Program source: svshm_string_write.c"
876 msgstr ""
877
878 #. type: Plain text
879 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
880 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
881 msgid ""
882 "The writer program takes three command-line arguments: the IDs of the shared "
883 "memory segment and semaphore set that have already been created by the "
884 "\"reader\", and a string. It attaches the shared memory segment into its "
885 "address space, and then decrements the semaphore value to 0 in order to "
886 "inform the \"reader\" that it can now examine the contents of the shared "
887 "memory."
888 msgstr ""
889
890 #. type: Plain text
891 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
892 #: opensuse-tumbleweed
893 #, no-wrap
894 msgid ""
895 "/* svshm_string_write.c\n"
896 "\\&\n"
897 " Licensed under GNU General Public License v2 or later.\n"
898 "*/\n"
899 "#include E<lt>err.hE<gt>\n"
900 "#include E<lt>stdio.hE<gt>\n"
901 "#include E<lt>stdlib.hE<gt>\n"
902 "#include E<lt>string.hE<gt>\n"
903 "#include E<lt>sys/sem.hE<gt>\n"
904 "#include E<lt>sys/shm.hE<gt>\n"
905 "\\&\n"
906 "#include \"svshm_string.h\"\n"
907 "\\&\n"
908 "int\n"
909 "main(int argc, char *argv[])\n"
910 "{\n"
911 " int semid, shmid;\n"
912 " char *addr;\n"
913 " size_t size;\n"
914 " struct sembuf sop;\n"
915 "\\&\n"
916 " if (argc != 4) {\n"
917 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
918 " exit(EXIT_FAILURE);\n"
919 " }\n"
920 "\\&\n"
921 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
922 " if (size E<gt> MEM_SIZE) {\n"
923 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
924 " exit(EXIT_FAILURE);\n"
925 " }\n"
926 "\\&\n"
927 " /* Get object IDs from command-line. */\n"
928 "\\&\n"
929 " shmid = atoi(argv[1]);\n"
930 " semid = atoi(argv[2]);\n"
931 "\\&\n"
932 " /* Attach shared memory into our address space and copy string\n"
933 " (including trailing null byte) into memory. */\n"
934 "\\&\n"
935 " addr = shmat(shmid, NULL, 0);\n"
936 " if (addr == (void *) -1)\n"
937 " err(EXIT_FAILURE, \"shmat\");\n"
938 "\\&\n"
939 " memcpy(addr, argv[3], size);\n"
940 "\\&\n"
941 " /* Decrement semaphore to 0. */\n"
942 "\\&\n"
943 " sop.sem_num = 0;\n"
944 " sop.sem_op = -1;\n"
945 " sop.sem_flg = 0;\n"
946 "\\&\n"
947 " if (semop(semid, &sop, 1) == -1)\n"
948 " err(EXIT_FAILURE, \"semop\");\n"
949 "\\&\n"
950 " exit(EXIT_SUCCESS);\n"
951 "}\n"
952 msgstr ""
953
954 #. type: SH
955 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
956 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
957 #, no-wrap
958 msgid "SEE ALSO"
959 msgstr "VEJA TAMBÉM"
960
961 #. type: Plain text
962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
964 msgid ""
965 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
966 "B<shm_overview>(7), B<sysvipc>(7)"
967 msgstr ""
968 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
969 "B<shm_overview>(7), B<sysvipc>(7)"
970
971 #. type: TH
972 #: debian-trixie
973 #, no-wrap
974 msgid "2024-06-15"
975 msgstr "15 junho 2024"
976
977 #. type: TH
978 #: debian-trixie
979 #, no-wrap
980 msgid "Linux man-pages 6.9.1"
981 msgstr "Linux man-pages 6.9.1"
982
983 #. type: Plain text
984 #: debian-trixie
985 msgid "Standard C library (I<libc>, I<-lc>)"
986 msgstr "Biblioteca C Padrão (I<libc>, I<-lc>)"
987
988 #. type: Plain text
989 #: debian-trixie fedora-44 fedora-rawhide
990 #, fuzzy
991 #| msgid ""
992 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
993 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
994 #| "B<brk>."
995 msgid ""
996 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
997 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
998 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
999 msgstr ""
1000 "Valor I<shmid> inválido, desalinhado (isto é, sem alinhamento de página e "
1001 "B<SHM_RND> não foi especificado) ou valor I<shmaddr> inválido, ou falhando "
1002 "em anexar em B<brk>."
1003
1004 #. type: Plain text
1005 #: debian-trixie fedora-44 fedora-rawhide
1006 #, fuzzy, no-wrap
1007 #| msgid ""
1008 #| "$ B<./svshm_string_read >\n"
1009 #| "shmid = 1114194; semid = 15\n"
1010 msgid ""
1011 "$ B<./svshm_string_read>\n"
1012 "shmid = 1114194; semid = 15\n"
1013 msgstr ""
1014 "$ B<./svshm_string_read >\n"
1015 "shmid = 1114194; semid = 15\n"
1016
1017 #. type: Plain text
1018 #: debian-trixie fedora-44 fedora-rawhide
1019 #, fuzzy, no-wrap
1020 #| msgid "$ B<./svshm_string_write 1114194 15 \\(aqHello, world\\(aq>\n"
1021 msgid "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
1022 msgstr "$ B<./svshm_string_write 1114194 15 \\(aqHello, world\\(aq>\n"
1023
1024 #. type: Plain text
1025 #: debian-trixie fedora-44 fedora-rawhide
1026 #, no-wrap
1027 msgid ""
1028 "/* svshm_string.h\n"
1029 "\\&\n"
1030 " Licensed under GNU General Public License v2 or later.\n"
1031 "*/\n"
1032 "#ifndef SVSHM_STRING_H\n"
1033 "#define SVSHM_STRING_H\n"
1034 "\\&\n"
1035 "#include E<lt>stdio.hE<gt>\n"
1036 "#include E<lt>stdlib.hE<gt>\n"
1037 "#include E<lt>sys/sem.hE<gt>\n"
1038 "\\&\n"
1039 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1040 " } while (0)\n"
1041 "\\&\n"
1042 "union semun { /* Used in calls to semctl() */\n"
1043 " int val;\n"
1044 " struct semid_ds *buf;\n"
1045 " unsigned short *array;\n"
1046 "#if defined(__linux__)\n"
1047 " struct seminfo *__buf;\n"
1048 "#endif\n"
1049 "};\n"
1050 "\\&\n"
1051 "#define MEM_SIZE 4096\n"
1052 "\\&\n"
1053 "#endif // include guard\n"
1054 msgstr ""
1055
1056 #. type: Plain text
1057 #: debian-trixie fedora-44 fedora-rawhide
1058 #, no-wrap
1059 msgid ""
1060 "/* svshm_string_read.c\n"
1061 "\\&\n"
1062 " Licensed under GNU General Public License v2 or later.\n"
1063 "*/\n"
1064 "#include E<lt>stdio.hE<gt>\n"
1065 "#include E<lt>stdlib.hE<gt>\n"
1066 "#include E<lt>sys/ipc.hE<gt>\n"
1067 "#include E<lt>sys/sem.hE<gt>\n"
1068 "#include E<lt>sys/shm.hE<gt>\n"
1069 "\\&\n"
1070 "#include \"svshm_string.h\"\n"
1071 "\\&\n"
1072 "int\n"
1073 "main(void)\n"
1074 "{\n"
1075 " int semid, shmid;\n"
1076 " char *addr;\n"
1077 " union semun arg, dummy;\n"
1078 " struct sembuf sop;\n"
1079 "\\&\n"
1080 " /* Create shared memory and semaphore set containing one\n"
1081 " semaphore. */\n"
1082 "\\&\n"
1083 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
1084 " if (shmid == -1)\n"
1085 " errExit(\"shmget\");\n"
1086 "\\&\n"
1087 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
1088 " if (semid == -1)\n"
1089 " errExit(\"semget\");\n"
1090 "\\&\n"
1091 " /* Attach shared memory into our address space. */\n"
1092 "\\&\n"
1093 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
1094 " if (addr == (void *) -1)\n"
1095 " errExit(\"shmat\");\n"
1096 "\\&\n"
1097 " /* Initialize semaphore 0 in set with value 1. */\n"
1098 "\\&\n"
1099 " arg.val = 1;\n"
1100 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
1101 " errExit(\"semctl\");\n"
1102 "\\&\n"
1103 " printf(\"shmid = %d; semid = %d\\[rs]n\", shmid, semid);\n"
1104 "\\&\n"
1105 " /* Wait for semaphore value to become 0. */\n"
1106 "\\&\n"
1107 " sop.sem_num = 0;\n"
1108 " sop.sem_op = 0;\n"
1109 " sop.sem_flg = 0;\n"
1110 "\\&\n"
1111 " if (semop(semid, &sop, 1) == -1)\n"
1112 " errExit(\"semop\");\n"
1113 "\\&\n"
1114 " /* Print the string from shared memory. */\n"
1115 "\\&\n"
1116 " printf(\"%s\\[rs]n\", addr);\n"
1117 "\\&\n"
1118 " /* Remove shared memory and semaphore set. */\n"
1119 "\\&\n"
1120 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
1121 " errExit(\"shmctl\");\n"
1122 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
1123 " errExit(\"semctl\");\n"
1124 "\\&\n"
1125 " exit(EXIT_SUCCESS);\n"
1126 "}\n"
1127 msgstr ""
1128
1129 #. type: Plain text
1130 #: debian-trixie
1131 #, no-wrap
1132 msgid ""
1133 "/* svshm_string_write.c\n"
1134 "\\&\n"
1135 " Licensed under GNU General Public License v2 or later.\n"
1136 "*/\n"
1137 "#include E<lt>stdio.hE<gt>\n"
1138 "#include E<lt>stdlib.hE<gt>\n"
1139 "#include E<lt>string.hE<gt>\n"
1140 "#include E<lt>sys/sem.hE<gt>\n"
1141 "#include E<lt>sys/shm.hE<gt>\n"
1142 "\\&\n"
1143 "#include \"svshm_string.h\"\n"
1144 "\\&\n"
1145 "int\n"
1146 "main(int argc, char *argv[])\n"
1147 "{\n"
1148 " int semid, shmid;\n"
1149 " char *addr;\n"
1150 " size_t len;\n"
1151 " struct sembuf sop;\n"
1152 "\\&\n"
1153 " if (argc != 4) {\n"
1154 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1155 " exit(EXIT_FAILURE);\n"
1156 " }\n"
1157 "\\&\n"
1158 " len = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1159 " if (len E<gt> MEM_SIZE) {\n"
1160 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1161 " exit(EXIT_FAILURE);\n"
1162 " }\n"
1163 "\\&\n"
1164 " /* Get object IDs from command-line. */\n"
1165 "\\&\n"
1166 " shmid = atoi(argv[1]);\n"
1167 " semid = atoi(argv[2]);\n"
1168 "\\&\n"
1169 " /* Attach shared memory into our address space and copy string\n"
1170 " (including trailing null byte) into memory. */\n"
1171 "\\&\n"
1172 " addr = shmat(shmid, NULL, 0);\n"
1173 " if (addr == (void *) -1)\n"
1174 " errExit(\"shmat\");\n"
1175 "\\&\n"
1176 " memcpy(addr, argv[3], len);\n"
1177 "\\&\n"
1178 " /* Decrement semaphore to 0. */\n"
1179 "\\&\n"
1180 " sop.sem_num = 0;\n"
1181 " sop.sem_op = -1;\n"
1182 " sop.sem_flg = 0;\n"
1183 "\\&\n"
1184 " if (semop(semid, &sop, 1) == -1)\n"
1185 " errExit(\"semop\");\n"
1186 "\\&\n"
1187 " exit(EXIT_SUCCESS);\n"
1188 "}\n"
1189 msgstr ""
1190
1191 #. type: TH
1192 #: fedora-44 fedora-rawhide
1193 #, no-wrap
1194 msgid "2024-11-17"
1195 msgstr "17 novembro 2024"
1196
1197 #. type: TH
1198 #: fedora-44 fedora-rawhide
1199 #, no-wrap
1200 msgid "Linux man-pages 6.13"
1201 msgstr "Linux man-pages 6.13"
1202
1203 #. type: Plain text
1204 #: fedora-44 fedora-rawhide
1205 #, no-wrap
1206 msgid ""
1207 "/* svshm_string_write.c\n"
1208 "\\&\n"
1209 " Licensed under GNU General Public License v2 or later.\n"
1210 "*/\n"
1211 "#include E<lt>stdio.hE<gt>\n"
1212 "#include E<lt>stdlib.hE<gt>\n"
1213 "#include E<lt>string.hE<gt>\n"
1214 "#include E<lt>sys/sem.hE<gt>\n"
1215 "#include E<lt>sys/shm.hE<gt>\n"
1216 "\\&\n"
1217 "#include \"svshm_string.h\"\n"
1218 "\\&\n"
1219 "int\n"
1220 "main(int argc, char *argv[])\n"
1221 "{\n"
1222 " int semid, shmid;\n"
1223 " char *addr;\n"
1224 " size_t size;\n"
1225 " struct sembuf sop;\n"
1226 "\\&\n"
1227 " if (argc != 4) {\n"
1228 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1229 " exit(EXIT_FAILURE);\n"
1230 " }\n"
1231 "\\&\n"
1232 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1233 " if (size E<gt> MEM_SIZE) {\n"
1234 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1235 " exit(EXIT_FAILURE);\n"
1236 " }\n"
1237 "\\&\n"
1238 " /* Get object IDs from command-line. */\n"
1239 "\\&\n"
1240 " shmid = atoi(argv[1]);\n"
1241 " semid = atoi(argv[2]);\n"
1242 "\\&\n"
1243 " /* Attach shared memory into our address space and copy string\n"
1244 " (including trailing null byte) into memory. */\n"
1245 "\\&\n"
1246 " addr = shmat(shmid, NULL, 0);\n"
1247 " if (addr == (void *) -1)\n"
1248 " errExit(\"shmat\");\n"
1249 "\\&\n"
1250 " memcpy(addr, argv[3], size);\n"
1251 "\\&\n"
1252 " /* Decrement semaphore to 0. */\n"
1253 "\\&\n"
1254 " sop.sem_num = 0;\n"
1255 " sop.sem_op = -1;\n"
1256 " sop.sem_flg = 0;\n"
1257 "\\&\n"
1258 " if (semop(semid, &sop, 1) == -1)\n"
1259 " errExit(\"semop\");\n"
1260 "\\&\n"
1261 " exit(EXIT_SUCCESS);\n"
1262 "}\n"
1263 msgstr ""
1264
1265 #. type: TH
1266 #: mageia-cauldron
1267 #, no-wrap
1268 msgid "Linux man-pages 6.17"
1269 msgstr "Linux man-pages 6.17"
1270
1271 #. type: TH
1272 #: opensuse-leap-16-1 opensuse-tumbleweed
1273 #, no-wrap
1274 msgid "Linux man-pages (unreleased)"
1275 msgstr "Linux man-pages (não lançado)"