Debian Codegraph @

po/ko/man2/shmop.2.po

raw
1 # Korean translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # 정강훈 <[email protected]>, 2000.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n\n"
8 "POT-Creation-Date: 2026-06-05 06:43+0200\n"
9 "PO-Revision-Date: 2000-05-16 08:57+0900\n"
10 "Last-Translator: 정강훈 <[email protected]>\n"
11 "Language-Team: Korean <[email protected]>\n"
12 "Language: ko\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=1; plural=0;\n"
17
18 #. type: TH
19 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
20 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
21 #, no-wrap
22 msgid "SHMOP"
23 msgstr "SHMOP"
24
25 #. type: TH
26 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
27 #: opensuse-tumbleweed
28 #, no-wrap
29 msgid "2026-02-08"
30 msgstr "2026년 2월 8일"
31
32 #. type: TH
33 #: archlinux debian-unstable
34 #, no-wrap
35 msgid "Linux man-pages 6.18"
36 msgstr "Linux man-pages 6.18"
37
38 #. type: SH
39 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
40 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
41 #, no-wrap
42 msgid "NAME"
43 msgstr "이름"
44
45 #. type: Plain text
46 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
47 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
48 #, fuzzy
49 #| msgid "shmop - shared memory operations"
50 msgid "shmat, shmdt - System V shared memory operations"
51 msgstr "shmop - 공유 메모리 작동들"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "LIBRARY"
58 msgstr "라이브러리"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "Standard C library (I<libc>,\\ I<-lc>)"
64 msgstr "표준 C 라이브러리 (I<libc>,\\ I<-lc>)"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "SYNOPSIS"
71 msgstr "요약"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>sys/shm.hE<gt>>\n"
78 msgstr "B<#include E<lt>sys/shm.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid ""
85 "B<void *shmat(int >I<shmid>B<, const void *_Nullable >I<shmaddr>B<, int >I<shmflg>B<);>\n"
86 "B<int shmdt(const void *>I<shmaddr>B<);>\n"
87 msgstr ""
88 "B<void *shmat(int >I<shmid>B<, const void *_Nullable >I<shmaddr>B<, int >I<shmflg>B<);>\n"
89 "B<int shmdt(const void *>I<shmaddr>B<);>\n"
90
91 #. type: SH
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid "DESCRIPTION"
96 msgstr "설명"
97
98 #. type: SS
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid "shmat()"
103 msgstr "shmat()"
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 #, fuzzy
109 #| msgid ""
110 #| "The function B<shmat> attaches the shared memory segment identified by "
111 #| "B<shmid> to the data segment of the calling process. The attaching "
112 #| "address is specified by I<shmaddr> with one of the following criteria:"
113 msgid ""
114 "B<shmat>() attaches the System\\ V shared memory segment identified by "
115 "I<shmid> to the address space of the calling process. The attaching address "
116 "is specified by I<shmaddr> with one of the following criteria:"
117 msgstr ""
118 "B<shmat> 함수는 B<shmid> 로 식별되는 공유 메모리 세그먼트를 호출 프로세스의 "
119 "데이터 세그먼트에 연결한다. 연결될 주소는 다음 조건중 하나의 I<shmaddr> 로 "
120 "지정된다."
121
122 #. type: IP
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 #, no-wrap
126 msgid "\\[bu]"
127 msgstr "\\[bu]"
128
129 #. type: Plain text
130 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
131 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
132 msgid ""
133 "If I<shmaddr> is NULL, the system chooses a suitable (unused) page-aligned "
134 "address to attach the segment."
135 msgstr ""
136
137 #. type: Plain text
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 #, fuzzy
141 #| msgid ""
142 #| "If I<shmaddr> isn't B<0> and B<SHM_RND> is asserted in I<shmflg>, the "
143 #| "attach occurs at address equal to the rounding down of I<shmaddr> to a "
144 #| "multiple of B<SHMLBA>. Otherwise I<shmaddr> must be a page aligned "
145 #| "address at which the attach occurs."
146 msgid ""
147 "If I<shmaddr> isn't NULL and B<SHM_RND> is specified in I<shmflg>, the "
148 "attach occurs at the address equal to I<shmaddr> rounded down to the nearest "
149 "multiple of B<SHMLBA>."
150 msgstr ""
151 "I<shmaddr> 가 B<0> 이 아니고 B<SHM_RND> 가 I<shmflg> 에 지정되어 있으면, "
152 "I<shmaddr> 가 B<SHMLBA> 의 배수의 주소로 연결이 발생한다. 그렇지 않으면 "
153 "I<shmaddr> 는 연결할수 있는 정렬된 페이지 주소이어야 한다."
154
155 #. type: Plain text
156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
158 msgid ""
159 "Otherwise, I<shmaddr> must be a page-aligned address at which the attach "
160 "occurs."
161 msgstr ""
162
163 #. type: Plain text
164 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
165 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
166 msgid ""
167 "In addition to B<SHM_RND>, the following flags may be specified in the "
168 "I<shmflg> bit-mask argument:"
169 msgstr ""
170
171 #. type: TP
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 #, no-wrap
175 msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
176 msgstr ""
177
178 #. type: Plain text
179 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
180 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
181 msgid ""
182 "Allow the contents of the segment to be executed. The caller must have "
183 "execute permission on the segment."
184 msgstr ""
185
186 #. type: TP
187 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
188 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
189 #, no-wrap
190 msgid "B<SHM_RDONLY>"
191 msgstr "B<SHM_RDONLY>"
192
193 #. type: Plain text
194 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
195 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
196 #, fuzzy
197 #| msgid ""
198 #| "If B<SHM_RDONLY> is asserted in I<shmflg>, the segment is attached for "
199 #| "reading and the process must have read access permissions to the "
200 #| "segment. Otherwise the segment is attached for read and write and the "
201 #| "process must have read and write access permissions to the segment. "
202 #| "There is no notion of write-only shared memory segment."
203 msgid ""
204 "Attach the segment for read-only access. The process must have read "
205 "permission for the segment. If this flag is not specified, the segment is "
206 "attached for read and write access, and the process must have read and write "
207 "permission for the segment. There is no notion of a write-only shared "
208 "memory segment."
209 msgstr ""
210 "만일 B<SHM_RDONLY> 가 I<shmflg> 에 지정되면, 이 세그먼트는 읽기전용으로 연결"
211 "되며 프로세스는 세그먼트에 읽기 접근 허가권을 가져야만 한다. 그렇지 않으면 "
212 "세그먼트는 읽기-쓰기로 연결되며 프로세스는 세그먼트에 읽기-쓰기 접근 허가권들"
213 "을 가져야만 한다. 쓰기전용 공유메모리 세그먼트에 대한 표시는 없다."
214
215 #. type: TP
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 #, no-wrap
219 msgid "B<SHM_REMAP> (Linux-specific)"
220 msgstr ""
221
222 #. type: Plain text
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 msgid ""
226 "This flag specifies that the mapping of the segment should replace any "
227 "existing mapping in the range starting at I<shmaddr> and continuing for the "
228 "size of the segment. (Normally, an B<EINVAL> error would result if a "
229 "mapping already exists in this address range.) In this case, I<shmaddr> "
230 "must not be NULL."
231 msgstr ""
232
233 #. type: Plain text
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 msgid ""
237 "The B<brk>(2) value of the calling process is not altered by the attach. "
238 "The segment will automatically be detached at process exit. The same "
239 "segment may be attached as a read and as a read-write one, and more than "
240 "once, in the process's address space."
241 msgstr ""
242 "호출 프로세스의 B<brk>(2) 값은 연결시 바뀌어지지 않는다. 세그먼트는 프로세스"
243 "가 종료할때 자동적으로 분리된다. 같은 세그먼트는 그 프로세스 주소 공간에서 "
244 "읽기 전용으로, 읽기-쓰기로, 한번 이상 연결될수 있다."
245
246 #. type: Plain text
247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
249 #, fuzzy
250 #| msgid ""
251 #| "On a successful B<shmat> call the system updates the members of the "
252 #| "structure B<shmid_ds> associated to the shared memory segment as follows:"
253 msgid ""
254 "A successful B<shmat>() call updates the members of the I<shmid_ds> "
255 "structure (see B<shmctl>(2)) associated with the shared memory segment as "
256 "follows:"
257 msgstr ""
258 "성공시 B<shmat> 시스템 콜은 공유 메모리 세그먼트에서 다음과 같은 B<shmid_ds> "
259 "구조체 멤버들을 갱신한다."
260
261 #. type: Plain text
262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
264 msgid "I<shm_atime> is set to the current time."
265 msgstr "I<shm_atime> 는 현재 시간으로 설정된다."
266
267 #. type: Plain text
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 msgid "I<shm_lpid> is set to the process-ID of the calling process."
271 msgstr "I<shm_lpid> 는 호출 프로세스의 프로세스-ID로 설정된다."
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 msgid "I<shm_nattch> is incremented by one."
277 msgstr "I<shm_nattch> 는 1 증가한다."
278
279 #. type: SS
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 #, no-wrap
283 msgid "shmdt()"
284 msgstr "shmdt()"
285
286 #. type: Plain text
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 #, fuzzy
290 #| msgid ""
291 #| "The function B<shmdt> detaches from the calling process's data segment "
292 #| "the shared memory segment located at the address specified by "
293 #| "I<shmaddr>. The detaching shared memory segment must be one among the "
294 #| "currently attached ones (to the process's address space) with I<shmaddr> "
295 #| "equal to the value returned by the its attaching B<shmat> call."
296 msgid ""
297 "B<shmdt>() detaches the shared memory segment located at the address "
298 "specified by I<shmaddr> from the address space of the calling process. The "
299 "to-be-detached segment must be currently attached with I<shmaddr> equal to "
300 "the value returned by the attaching B<shmat>() call."
301 msgstr ""
302 "함수 B<shmdt> 는 호출 프로세스의 데이타 세그먼트에서 I<shmaddr> 로 지정된 주"
303 "소에 위치한 공유 메모리 세그먼트를 분리한다. 공유 메모리 세그먼트의 분리는 "
304 "B<shmat> 시그템 콜로 연결된 값과 같은 I<shmaddr> 를 가지고 있는 현재 연결된 "
305 "세그먼트들중 하나(프로세스의 주소 공간)이어야 한다."
306
307 #. type: Plain text
308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
310 #, fuzzy
311 #| msgid ""
312 #| "On a successful B<shmdt> call the system updates the members of the "
313 #| "structure B<shmid_ds> associated to the shared memory segment as follows:"
314 msgid ""
315 "On a successful B<shmdt>() call, the system updates the members of the "
316 "I<shmid_ds> structure associated with the shared memory segment as follows:"
317 msgstr ""
318 "성공시, B<shmdt> 시스템 콜은 공유 메모리 세그먼트에서 다음과 같은 "
319 "B<shmid_ds> 구조체 멤버들을 갱신한다."
320
321 #. type: Plain text
322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
324 msgid "I<shm_dtime> is set to the current time."
325 msgstr "I<shm_dtime> 는 현재 시간으로 설정된다."
326
327 #. type: Plain text
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 msgid ""
331 "I<shm_nattch> is decremented by one. If it becomes 0 and the segment is "
332 "marked for deletion, the segment is deleted."
333 msgstr ""
334 "I<shm_nattch> 는 1 감소한다. 만일 0이고 세그먼트가 삭제 표시되어 있드면 세그"
335 "먼트는 삭제된다."
336
337 #. type: SH
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 #, no-wrap
341 msgid "RETURN VALUE"
342 msgstr "반환값"
343
344 #. type: Plain text
345 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
346 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
347 msgid ""
348 "On success, B<shmat>() returns the address of the attached shared memory "
349 "segment; on error, I<(void\\ *)\\ -1> is returned, and I<errno> is set to "
350 "indicate the error."
351 msgstr ""
352
353 #. type: Plain text
354 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
355 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
356 #, fuzzy
357 #| msgid ""
358 #| "On success, zero is returned. On error, -1 is returned, and I<errno> is "
359 #| "set appropriately."
360 msgid ""
361 "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> is "
362 "set to indicate the error."
363 msgstr ""
364 "성공시, 0이 리턴된다. 에러시, -1이 리턴되며, I<errno>는 적당한 값으로 설정된"
365 "다."
366
367 #. type: SH
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 #, no-wrap
371 msgid "ERRORS"
372 msgstr "에러"
373
374 #. type: Plain text
375 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
376 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
377 msgid "B<shmat>() can fail with one of the following errors:"
378 msgstr ""
379
380 #. type: TP
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid "B<EACCES>"
385 msgstr "B<EACCES>"
386
387 #. type: Plain text
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 msgid ""
391 "The calling process does not have the required permissions for the requested "
392 "attach type, and does not have the B<CAP_IPC_OWNER> capability in the user "
393 "namespace that governs its IPC namespace."
394 msgstr ""
395
396 #. type: TP
397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
399 #, no-wrap
400 msgid "B<EIDRM>"
401 msgstr "B<EIDRM>"
402
403 #. type: Plain text
404 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
405 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
406 msgid "I<shmid> points to a removed identifier."
407 msgstr ""
408
409 #. type: TP
410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
412 #, no-wrap
413 msgid "B<EINVAL>"
414 msgstr "B<EINVAL>"
415
416 #. type: Plain text
417 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
418 #: opensuse-tumbleweed
419 #, fuzzy
420 #| msgid ""
421 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
422 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
423 #| "B<brk>."
424 msgid ""
425 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
426 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
427 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
428 msgstr ""
429 "유효하지 않은 I<shmid> 값, 정렬되지 않은(즉, 페이지 정렬이 아니고 B<SHM_RND>"
430 "가 지정되지 않았다.) 또는 유효하지 않은 I<shmaddr> 값, 또는 B<brk> 에 연결 "
431 "실패."
432
433 #. type: TP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "B<ENOMEM>"
438 msgstr "B<ENOMEM>"
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid "Could not allocate memory for the descriptor or for the page tables."
444 msgstr "기술자나 페이지 테이블들을 위해 메모리를 할당할수 없다."
445
446 #. type: Plain text
447 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
448 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
449 msgid "B<shmdt>() can fail with one of the following errors:"
450 msgstr ""
451
452 #. The following since Linux 2.6.17-rc1:
453 #. type: Plain text
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 msgid ""
457 "There is no shared memory segment attached at I<shmaddr>; or, I<shmaddr> is "
458 "not aligned on a page boundary."
459 msgstr ""
460
461 #. type: SH
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 #, no-wrap
465 msgid "STANDARDS"
466 msgstr "표준"
467
468 #. type: Plain text
469 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
470 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
471 msgid "POSIX.1-2008."
472 msgstr "POSIX.1-2008."
473
474 #. type: SH
475 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
476 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
477 #, no-wrap
478 msgid "HISTORY"
479 msgstr "이력"
480
481 #. SVr4 documents an additional error condition EMFILE.
482 #. type: Plain text
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 msgid "POSIX.1-2001, SVr4."
486 msgstr "POSIX.1-2001, SVr4."
487
488 #. type: Plain text
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 #, fuzzy
492 #| msgid ""
493 #| "SVr4, SVID. SVr4 documents an additional error condition EMFILE. In "
494 #| "SVID-v4 the type of the I<shmaddr> argument was changed from B<char *> "
495 #| "into B<const void *>, and the returned type of I<shmat>() from B<char *> "
496 #| "into B<void *>. (Linux libc4 and libc5 have the B<char *> prototypes; "
497 #| "glibc2 has B<void *>.)"
498 msgid ""
499 "In SVID 3 (or perhaps earlier), the type of the I<shmaddr> argument was "
500 "changed from I<char\\ *> into I<const void\\ *>, and the returned type of "
501 "B<shmat>() from I<char\\ *> into I<void\\ *>."
502 msgstr ""
503 "SVr4, SVID. SVr4는 EMFILE 에러 조건을 문서화했다. SVID-v4에서 I<shmaddr> 인"
504 "자는 B<char *> 에서 B<const void *> 로 바뀌었으며 I<shmat>()의 리턴 타입은 "
505 "B<char *> 에서 B<void *> 으로 바뀌었다. (Linux libc4 와 libc5는 B<char *> 타"
506 "입을 가지고 있다.; glibc2는 B<void *> 을 가지고 있다.)"
507
508 #. type: Plain text
509 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
510 #: opensuse-tumbleweed
511 msgid ""
512 "POSIX.1-2024 changed the error code from I<(void\\ *)\\ -1> to B<SHM_FAILED>."
513 msgstr ""
514
515 #. type: SH
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 #, no-wrap
519 msgid "NOTES"
520 msgstr "주의"
521
522 #. type: Plain text
523 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
524 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
525 msgid ""
526 "After a B<fork>(2), the child inherits the attached shared memory segments."
527 msgstr ""
528 "B<fork>(2) 후에 자식 프로세스는 연결된 공유 메모리 세그먼트들을 상속한다."
529
530 #. type: Plain text
531 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
532 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
533 #, fuzzy
534 #| msgid ""
535 #| "After an B<exec()> all attached shared memory segments are detached (not "
536 #| "destroyed)."
537 msgid ""
538 "After an B<execve>(2), all attached shared memory segments are detached from "
539 "the process."
540 msgstr ""
541 "B<exec()> 후에 모든 연결된 공유 메모리 세그먼트들은 분리된다.(파괴되는것이 아"
542 "니다.)"
543
544 #. type: Plain text
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 #, fuzzy
548 #| msgid ""
549 #| "Upon B<exit()> all attached shared memory segments are detached (not "
550 #| "destroyed)."
551 msgid ""
552 "Upon B<_exit>(2), all attached shared memory segments are detached from the "
553 "process."
554 msgstr ""
555 "B<exit()> 시 모든 연결된 공유 메모리 세그먼트는 분리된다.(파괴되는 것이 아니"
556 "다.)"
557
558 #. type: Plain text
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 msgid ""
562 "Using B<shmat>() with I<shmaddr> equal to NULL is the preferred, portable "
563 "way of attaching a shared memory segment. Be aware that the shared memory "
564 "segment attached in this way may be attached at different addresses in "
565 "different processes. Therefore, any pointers maintained within the shared "
566 "memory must be made relative (typically to the starting address of the "
567 "segment), rather than absolute."
568 msgstr ""
569
570 #. type: Plain text
571 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
572 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
573 msgid ""
574 "On Linux, it is possible to attach a shared memory segment even if it is "
575 "already marked to be deleted. However, POSIX.1 does not specify this "
576 "behavior and many other implementations do not support it."
577 msgstr ""
578
579 #. type: Plain text
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 #, fuzzy
583 #| msgid ""
584 #| "The following is a system parameter affecting a B<shmat> system call:"
585 msgid "The following system parameter affects B<shmat>():"
586 msgstr "다음은 B<shmat> 시스템 콜에 영향을 미치는 시스템 인자이다:"
587
588 #. type: TP
589 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
590 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
591 #, no-wrap
592 msgid "B<SHMLBA>"
593 msgstr "B<SHMLBA>"
594
595 #. type: Plain text
596 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
597 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
598 msgid ""
599 "Segment low boundary address multiple. When explicitly specifying an attach "
600 "address in a call to B<shmat>(), the caller should ensure that the address "
601 "is a multiple of this value. This is necessary on some architectures, in "
602 "order either to ensure good CPU cache performance or to ensure that "
603 "different attaches of the same segment have consistent views within the CPU "
604 "cache. B<SHMLBA> is normally some multiple of the system page size. (On "
605 "many Linux architectures, B<SHMLBA> is the same as the system page size.)"
606 msgstr ""
607
608 #. type: Plain text
609 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
610 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
611 #, fuzzy
612 #| msgid ""
613 #| "The implementation has no intrinsic limit to the per process maximum "
614 #| "number of shared memory segments (B<SHMSEG>)"
615 msgid ""
616 "The implementation places no intrinsic per-process limit on the number of "
617 "shared memory segments (B<SHMSEG>)."
618 msgstr ""
619 "수행시 프로세스당 공유 메모리 세그먼트 최대수에 어떠한 내부 제한도 없다. "
620 "(B<SHMSEG>)"
621
622 #. type: SH
623 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
624 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
625 #, no-wrap
626 msgid "EXAMPLES"
627 msgstr "폐제"
628
629 #. type: Plain text
630 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
631 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
632 msgid ""
633 "The two programs shown below exchange a string using a shared memory "
634 "segment. Further details about the programs are given below. First, we "
635 "show a shell session demonstrating their use."
636 msgstr ""
637
638 #. type: Plain text
639 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
640 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
641 msgid ""
642 "In one terminal window, we run the \"reader\" program, which creates a "
643 "System V shared memory segment and a System V semaphore set. The program "
644 "prints out the IDs of the created objects, and then waits for the semaphore "
645 "to change value."
646 msgstr ""
647
648 #. type: Plain text
649 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
650 #: opensuse-tumbleweed
651 #, fuzzy, no-wrap
652 #| msgid ""
653 #| "$ B<./svshm_string_read>\n"
654 #| "shmid = 1114194; semid = 15\n"
655 msgid ""
656 "$B< ./svshm_string_read>;\n"
657 "shmid = 1114194\n"
658 "semid = 15\n"
659 msgstr ""
660 "$ B<./svshm_string_read>\n"
661 "shmid = 1114194; semid = 15\n"
662
663 #. type: Plain text
664 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
665 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
666 msgid ""
667 "In another terminal window, we run the \"writer\" program. The \"writer\" "
668 "program takes three command-line arguments: the IDs of the shared memory "
669 "segment and semaphore set created by the \"reader\", and a string. It "
670 "attaches the existing shared memory segment, copies the string to the shared "
671 "memory, and modifies the semaphore value."
672 msgstr ""
673
674 #. type: Plain text
675 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
676 #: opensuse-tumbleweed
677 #, fuzzy, no-wrap
678 #| msgid "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
679 msgid "$B< ./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>;\n"
680 msgstr "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
681
682 #. type: Plain text
683 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
684 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
685 msgid ""
686 "Returning to the terminal where the \"reader\" is running, we see that the "
687 "program has ceased waiting on the semaphore and has printed the string that "
688 "was copied into the shared memory segment by the writer:"
689 msgstr ""
690
691 #. type: Plain text
692 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
693 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
694 #, no-wrap
695 msgid "Hello, world\n"
696 msgstr "Hello, world\n"
697
698 #. type: SS
699 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
700 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
701 #, no-wrap
702 msgid "Program source: svshm_string.h"
703 msgstr ""
704
705 #. type: Plain text
706 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
707 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
708 msgid ""
709 "The following header file is included by the \"reader\" and \"writer\" "
710 "programs:"
711 msgstr ""
712
713 #. type: Plain text
714 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
715 #: opensuse-tumbleweed
716 #, no-wrap
717 msgid ""
718 "/* svshm_string.h\n"
719 "\\&\n"
720 " Licensed under GNU General Public License v2 or later.\n"
721 "*/\n"
722 "#ifndef SVSHM_STRING_H\n"
723 "#define SVSHM_STRING_H\n"
724 "\\&\n"
725 "#include E<lt>err.hE<gt>\n"
726 "#include E<lt>stdio.hE<gt>\n"
727 "#include E<lt>stdlib.hE<gt>\n"
728 "#include E<lt>sys/sem.hE<gt>\n"
729 "\\&\n"
730 "union semun { /* Used in calls to semctl() */\n"
731 " int val;\n"
732 " struct semid_ds *buf;\n"
733 " unsigned short *array;\n"
734 "#if defined(__linux__)\n"
735 " struct seminfo *__buf;\n"
736 "#endif\n"
737 "};\n"
738 "\\&\n"
739 "#define MEM_SIZE 4096\n"
740 "\\&\n"
741 "#endif // include guard\n"
742 msgstr ""
743
744 #. type: SS
745 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
746 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
747 #, no-wrap
748 msgid "Program source: svshm_string_read.c"
749 msgstr ""
750
751 #. type: Plain text
752 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
753 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
754 msgid ""
755 "The \"reader\" program creates a shared memory segment and a semaphore set "
756 "containing one semaphore. It then attaches the shared memory object into "
757 "its address space and initializes the semaphore value to 1. Finally, the "
758 "program waits for the semaphore value to become 0, and afterwards prints the "
759 "string that has been copied into the shared memory segment by the \"writer\"."
760 msgstr ""
761
762 #. type: Plain text
763 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
764 #: opensuse-tumbleweed
765 #, no-wrap
766 msgid ""
767 "/* svshm_string_read.c\n"
768 "\\&\n"
769 " Licensed under GNU General Public License v2 or later.\n"
770 "*/\n"
771 "#include E<lt>err.hE<gt>\n"
772 "#include E<lt>stdio.hE<gt>\n"
773 "#include E<lt>stdlib.hE<gt>\n"
774 "#include E<lt>sys/ipc.hE<gt>\n"
775 "#include E<lt>sys/sem.hE<gt>\n"
776 "#include E<lt>sys/shm.hE<gt>\n"
777 "\\&\n"
778 "#include \"svshm_string.h\"\n"
779 "\\&\n"
780 "int\n"
781 "main(void)\n"
782 "{\n"
783 " int semid, shmid;\n"
784 " char *addr;\n"
785 " union semun arg, dummy;\n"
786 " struct sembuf sop;\n"
787 "\\&\n"
788 " /* Create shared memory and semaphore set containing one\n"
789 " semaphore. */\n"
790 "\\&\n"
791 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
792 " if (shmid == -1)\n"
793 " err(EXIT_FAILURE, \"shmget\");\n"
794 "\\&\n"
795 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
796 " if (semid == -1)\n"
797 " err(EXIT_FAILURE, \"semget\");\n"
798 "\\&\n"
799 " /* Attach shared memory into our address space. */\n"
800 "\\&\n"
801 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
802 " if (addr == (void *) -1)\n"
803 " err(EXIT_FAILURE, \"shmat\");\n"
804 "\\&\n"
805 " /* Initialize semaphore 0 in set with value 1. */\n"
806 "\\&\n"
807 " arg.val = 1;\n"
808 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
809 " err(EXIT_FAILURE, \"semctl\");\n"
810 "\\&\n"
811 " printf(\"shmid = %d\\[rs]n\", shmid);\n"
812 " printf(\"semid = %d\\[rs]n\", semid);\n"
813 "\\&\n"
814 " /* Wait for semaphore value to become 0. */\n"
815 "\\&\n"
816 " sop.sem_num = 0;\n"
817 " sop.sem_op = 0;\n"
818 " sop.sem_flg = 0;\n"
819 "\\&\n"
820 " if (semop(semid, &sop, 1) == -1)\n"
821 " err(EXIT_FAILURE, \"semop\");\n"
822 "\\&\n"
823 " /* Print the string from shared memory. */\n"
824 "\\&\n"
825 " printf(\"%s\\[rs]n\", addr);\n"
826 "\\&\n"
827 " /* Remove shared memory and semaphore set. */\n"
828 "\\&\n"
829 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
830 " err(EXIT_FAILURE, \"shmctl\");\n"
831 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
832 " err(EXIT_FAILURE, \"semctl\");\n"
833 "\\&\n"
834 " exit(EXIT_SUCCESS);\n"
835 "}\n"
836 msgstr ""
837
838 #. type: SS
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 #, no-wrap
842 msgid "Program source: svshm_string_write.c"
843 msgstr ""
844
845 #. type: Plain text
846 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
847 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
848 msgid ""
849 "The writer program takes three command-line arguments: the IDs of the shared "
850 "memory segment and semaphore set that have already been created by the "
851 "\"reader\", and a string. It attaches the shared memory segment into its "
852 "address space, and then decrements the semaphore value to 0 in order to "
853 "inform the \"reader\" that it can now examine the contents of the shared "
854 "memory."
855 msgstr ""
856
857 #. type: Plain text
858 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
859 #: opensuse-tumbleweed
860 #, no-wrap
861 msgid ""
862 "/* svshm_string_write.c\n"
863 "\\&\n"
864 " Licensed under GNU General Public License v2 or later.\n"
865 "*/\n"
866 "#include E<lt>err.hE<gt>\n"
867 "#include E<lt>stdio.hE<gt>\n"
868 "#include E<lt>stdlib.hE<gt>\n"
869 "#include E<lt>string.hE<gt>\n"
870 "#include E<lt>sys/sem.hE<gt>\n"
871 "#include E<lt>sys/shm.hE<gt>\n"
872 "\\&\n"
873 "#include \"svshm_string.h\"\n"
874 "\\&\n"
875 "int\n"
876 "main(int argc, char *argv[])\n"
877 "{\n"
878 " int semid, shmid;\n"
879 " char *addr;\n"
880 " size_t size;\n"
881 " struct sembuf sop;\n"
882 "\\&\n"
883 " if (argc != 4) {\n"
884 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
885 " exit(EXIT_FAILURE);\n"
886 " }\n"
887 "\\&\n"
888 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
889 " if (size E<gt> MEM_SIZE) {\n"
890 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
891 " exit(EXIT_FAILURE);\n"
892 " }\n"
893 "\\&\n"
894 " /* Get object IDs from command-line. */\n"
895 "\\&\n"
896 " shmid = atoi(argv[1]);\n"
897 " semid = atoi(argv[2]);\n"
898 "\\&\n"
899 " /* Attach shared memory into our address space and copy string\n"
900 " (including trailing null byte) into memory. */\n"
901 "\\&\n"
902 " addr = shmat(shmid, NULL, 0);\n"
903 " if (addr == (void *) -1)\n"
904 " err(EXIT_FAILURE, \"shmat\");\n"
905 "\\&\n"
906 " memcpy(addr, argv[3], size);\n"
907 "\\&\n"
908 " /* Decrement semaphore to 0. */\n"
909 "\\&\n"
910 " sop.sem_num = 0;\n"
911 " sop.sem_op = -1;\n"
912 " sop.sem_flg = 0;\n"
913 "\\&\n"
914 " if (semop(semid, &sop, 1) == -1)\n"
915 " err(EXIT_FAILURE, \"semop\");\n"
916 "\\&\n"
917 " exit(EXIT_SUCCESS);\n"
918 "}\n"
919 msgstr ""
920
921 #. type: SH
922 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
923 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
924 #, no-wrap
925 msgid "SEE ALSO"
926 msgstr "추가 참조"
927
928 #. type: Plain text
929 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
930 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
931 msgid ""
932 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
933 "B<shm_overview>(7), B<sysvipc>(7)"
934 msgstr ""
935 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
936 "B<shm_overview>(7), B<sysvipc>(7)"
937
938 #. type: TH
939 #: debian-trixie
940 #, no-wrap
941 msgid "2024-06-15"
942 msgstr "2024년 6월 15일"
943
944 #. type: TH
945 #: debian-trixie
946 #, no-wrap
947 msgid "Linux man-pages 6.9.1"
948 msgstr "Linux man-pages 6.9.1"
949
950 #. type: Plain text
951 #: debian-trixie
952 msgid "Standard C library (I<libc>, I<-lc>)"
953 msgstr "표준 C 라이브러리 (I<libc>, I<-lc>)"
954
955 #. type: Plain text
956 #: debian-trixie fedora-44 fedora-rawhide
957 #, fuzzy
958 #| msgid ""
959 #| "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> "
960 #| "was not specified) or invalid I<shmaddr> value, or failing attach at "
961 #| "B<brk>."
962 msgid ""
963 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
964 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
965 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
966 msgstr ""
967 "유효하지 않은 I<shmid> 값, 정렬되지 않은(즉, 페이지 정렬이 아니고 B<SHM_RND>"
968 "가 지정되지 않았다.) 또는 유효하지 않은 I<shmaddr> 값, 또는 B<brk> 에 연결 "
969 "실패."
970
971 #. type: Plain text
972 #: debian-trixie fedora-44 fedora-rawhide
973 #, no-wrap
974 msgid ""
975 "$ B<./svshm_string_read>\n"
976 "shmid = 1114194; semid = 15\n"
977 msgstr ""
978 "$ B<./svshm_string_read>\n"
979 "shmid = 1114194; semid = 15\n"
980
981 #. type: Plain text
982 #: debian-trixie fedora-44 fedora-rawhide
983 #, no-wrap
984 msgid "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
985 msgstr "$ B<./svshm_string_write 1114194 15 \\[aq]Hello, world\\[aq]>\n"
986
987 #. type: Plain text
988 #: debian-trixie fedora-44 fedora-rawhide
989 #, no-wrap
990 msgid ""
991 "/* svshm_string.h\n"
992 "\\&\n"
993 " Licensed under GNU General Public License v2 or later.\n"
994 "*/\n"
995 "#ifndef SVSHM_STRING_H\n"
996 "#define SVSHM_STRING_H\n"
997 "\\&\n"
998 "#include E<lt>stdio.hE<gt>\n"
999 "#include E<lt>stdlib.hE<gt>\n"
1000 "#include E<lt>sys/sem.hE<gt>\n"
1001 "\\&\n"
1002 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1003 " } while (0)\n"
1004 "\\&\n"
1005 "union semun { /* Used in calls to semctl() */\n"
1006 " int val;\n"
1007 " struct semid_ds *buf;\n"
1008 " unsigned short *array;\n"
1009 "#if defined(__linux__)\n"
1010 " struct seminfo *__buf;\n"
1011 "#endif\n"
1012 "};\n"
1013 "\\&\n"
1014 "#define MEM_SIZE 4096\n"
1015 "\\&\n"
1016 "#endif // include guard\n"
1017 msgstr ""
1018
1019 #. type: Plain text
1020 #: debian-trixie fedora-44 fedora-rawhide
1021 #, no-wrap
1022 msgid ""
1023 "/* svshm_string_read.c\n"
1024 "\\&\n"
1025 " Licensed under GNU General Public License v2 or later.\n"
1026 "*/\n"
1027 "#include E<lt>stdio.hE<gt>\n"
1028 "#include E<lt>stdlib.hE<gt>\n"
1029 "#include E<lt>sys/ipc.hE<gt>\n"
1030 "#include E<lt>sys/sem.hE<gt>\n"
1031 "#include E<lt>sys/shm.hE<gt>\n"
1032 "\\&\n"
1033 "#include \"svshm_string.h\"\n"
1034 "\\&\n"
1035 "int\n"
1036 "main(void)\n"
1037 "{\n"
1038 " int semid, shmid;\n"
1039 " char *addr;\n"
1040 " union semun arg, dummy;\n"
1041 " struct sembuf sop;\n"
1042 "\\&\n"
1043 " /* Create shared memory and semaphore set containing one\n"
1044 " semaphore. */\n"
1045 "\\&\n"
1046 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
1047 " if (shmid == -1)\n"
1048 " errExit(\"shmget\");\n"
1049 "\\&\n"
1050 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
1051 " if (semid == -1)\n"
1052 " errExit(\"semget\");\n"
1053 "\\&\n"
1054 " /* Attach shared memory into our address space. */\n"
1055 "\\&\n"
1056 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
1057 " if (addr == (void *) -1)\n"
1058 " errExit(\"shmat\");\n"
1059 "\\&\n"
1060 " /* Initialize semaphore 0 in set with value 1. */\n"
1061 "\\&\n"
1062 " arg.val = 1;\n"
1063 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
1064 " errExit(\"semctl\");\n"
1065 "\\&\n"
1066 " printf(\"shmid = %d; semid = %d\\[rs]n\", shmid, semid);\n"
1067 "\\&\n"
1068 " /* Wait for semaphore value to become 0. */\n"
1069 "\\&\n"
1070 " sop.sem_num = 0;\n"
1071 " sop.sem_op = 0;\n"
1072 " sop.sem_flg = 0;\n"
1073 "\\&\n"
1074 " if (semop(semid, &sop, 1) == -1)\n"
1075 " errExit(\"semop\");\n"
1076 "\\&\n"
1077 " /* Print the string from shared memory. */\n"
1078 "\\&\n"
1079 " printf(\"%s\\[rs]n\", addr);\n"
1080 "\\&\n"
1081 " /* Remove shared memory and semaphore set. */\n"
1082 "\\&\n"
1083 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
1084 " errExit(\"shmctl\");\n"
1085 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
1086 " errExit(\"semctl\");\n"
1087 "\\&\n"
1088 " exit(EXIT_SUCCESS);\n"
1089 "}\n"
1090 msgstr ""
1091
1092 #. type: Plain text
1093 #: debian-trixie
1094 #, no-wrap
1095 msgid ""
1096 "/* svshm_string_write.c\n"
1097 "\\&\n"
1098 " Licensed under GNU General Public License v2 or later.\n"
1099 "*/\n"
1100 "#include E<lt>stdio.hE<gt>\n"
1101 "#include E<lt>stdlib.hE<gt>\n"
1102 "#include E<lt>string.hE<gt>\n"
1103 "#include E<lt>sys/sem.hE<gt>\n"
1104 "#include E<lt>sys/shm.hE<gt>\n"
1105 "\\&\n"
1106 "#include \"svshm_string.h\"\n"
1107 "\\&\n"
1108 "int\n"
1109 "main(int argc, char *argv[])\n"
1110 "{\n"
1111 " int semid, shmid;\n"
1112 " char *addr;\n"
1113 " size_t len;\n"
1114 " struct sembuf sop;\n"
1115 "\\&\n"
1116 " if (argc != 4) {\n"
1117 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1118 " exit(EXIT_FAILURE);\n"
1119 " }\n"
1120 "\\&\n"
1121 " len = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1122 " if (len E<gt> MEM_SIZE) {\n"
1123 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1124 " exit(EXIT_FAILURE);\n"
1125 " }\n"
1126 "\\&\n"
1127 " /* Get object IDs from command-line. */\n"
1128 "\\&\n"
1129 " shmid = atoi(argv[1]);\n"
1130 " semid = atoi(argv[2]);\n"
1131 "\\&\n"
1132 " /* Attach shared memory into our address space and copy string\n"
1133 " (including trailing null byte) into memory. */\n"
1134 "\\&\n"
1135 " addr = shmat(shmid, NULL, 0);\n"
1136 " if (addr == (void *) -1)\n"
1137 " errExit(\"shmat\");\n"
1138 "\\&\n"
1139 " memcpy(addr, argv[3], len);\n"
1140 "\\&\n"
1141 " /* Decrement semaphore to 0. */\n"
1142 "\\&\n"
1143 " sop.sem_num = 0;\n"
1144 " sop.sem_op = -1;\n"
1145 " sop.sem_flg = 0;\n"
1146 "\\&\n"
1147 " if (semop(semid, &sop, 1) == -1)\n"
1148 " errExit(\"semop\");\n"
1149 "\\&\n"
1150 " exit(EXIT_SUCCESS);\n"
1151 "}\n"
1152 msgstr ""
1153
1154 #. type: TH
1155 #: fedora-44 fedora-rawhide
1156 #, no-wrap
1157 msgid "2024-11-17"
1158 msgstr "2024년 11월 17일"
1159
1160 #. type: TH
1161 #: fedora-44 fedora-rawhide
1162 #, no-wrap
1163 msgid "Linux man-pages 6.13"
1164 msgstr "Linux man-pages 6.13"
1165
1166 #. type: Plain text
1167 #: fedora-44 fedora-rawhide
1168 #, no-wrap
1169 msgid ""
1170 "/* svshm_string_write.c\n"
1171 "\\&\n"
1172 " Licensed under GNU General Public License v2 or later.\n"
1173 "*/\n"
1174 "#include E<lt>stdio.hE<gt>\n"
1175 "#include E<lt>stdlib.hE<gt>\n"
1176 "#include E<lt>string.hE<gt>\n"
1177 "#include E<lt>sys/sem.hE<gt>\n"
1178 "#include E<lt>sys/shm.hE<gt>\n"
1179 "\\&\n"
1180 "#include \"svshm_string.h\"\n"
1181 "\\&\n"
1182 "int\n"
1183 "main(int argc, char *argv[])\n"
1184 "{\n"
1185 " int semid, shmid;\n"
1186 " char *addr;\n"
1187 " size_t size;\n"
1188 " struct sembuf sop;\n"
1189 "\\&\n"
1190 " if (argc != 4) {\n"
1191 " fprintf(stderr, \"Usage: %s shmid semid string\\[rs]n\", argv[0]);\n"
1192 " exit(EXIT_FAILURE);\n"
1193 " }\n"
1194 "\\&\n"
1195 " size = strlen(argv[3]) + 1; /* +1 to include trailing \\[aq]\\[rs]0\\[aq] */\n"
1196 " if (size E<gt> MEM_SIZE) {\n"
1197 " fprintf(stderr, \"String is too big!\\[rs]n\");\n"
1198 " exit(EXIT_FAILURE);\n"
1199 " }\n"
1200 "\\&\n"
1201 " /* Get object IDs from command-line. */\n"
1202 "\\&\n"
1203 " shmid = atoi(argv[1]);\n"
1204 " semid = atoi(argv[2]);\n"
1205 "\\&\n"
1206 " /* Attach shared memory into our address space and copy string\n"
1207 " (including trailing null byte) into memory. */\n"
1208 "\\&\n"
1209 " addr = shmat(shmid, NULL, 0);\n"
1210 " if (addr == (void *) -1)\n"
1211 " errExit(\"shmat\");\n"
1212 "\\&\n"
1213 " memcpy(addr, argv[3], size);\n"
1214 "\\&\n"
1215 " /* Decrement semaphore to 0. */\n"
1216 "\\&\n"
1217 " sop.sem_num = 0;\n"
1218 " sop.sem_op = -1;\n"
1219 " sop.sem_flg = 0;\n"
1220 "\\&\n"
1221 " if (semop(semid, &sop, 1) == -1)\n"
1222 " errExit(\"semop\");\n"
1223 "\\&\n"
1224 " exit(EXIT_SUCCESS);\n"
1225 "}\n"
1226 msgstr ""
1227
1228 #. type: TH
1229 #: mageia-cauldron
1230 #, no-wrap
1231 msgid "Linux man-pages 6.17"
1232 msgstr "Linux man-pages 6.17"
1233
1234 #. type: TH
1235 #: opensuse-leap-16-1 opensuse-tumbleweed
1236 #, no-wrap
1237 msgid "Linux man-pages (unreleased)"
1238 msgstr "Linux man-pages (미공개)"