OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man7 / shm_overview.7
1 .\" t
2 .\" Copyright (C) 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
34 .\"         all rights reserved.
35 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.04
36 .\"
37 .TH SHM_OVERVIEW 7 2010\-09\-10 Linux "Linux Programmer's Manual"
38 .SH 名前
39 shm_overview \- POSIX 共有メモリの概要
40 .SH 説明
41 POSIX 共有メモリ API を使用すると、メモリのある領域を共有して、 プロセス間で情報をやり取りすることができる。
42
43 この API では以下のインターフェースが採用されている。
44 .TP  15
45 \fBshm_open\fP(3)
46 新しいオブジェクトを生成しオープンする、もしくは 既存のオブジェクトをオープンする。これは \fBopen\fP(2)
47 と同じである。下記にある他のインターフェースで使用する ファイルディスクリプタを返す。
48 .TP 
49 \fBftruncate\fP(2)
50 共有メモリオブジェクトの大きさを設定する。
51 .TP 
52 \fBmmap\fP(2)
53 呼び出したプロセスの仮想アドレス空間に共有メモリオブジェクトを マップする。
54 .TP 
55 \fBmunmap\fP(2)
56 呼び出したプロセスの仮想アドレス空間から 共有メモリオブジェクトをアンマップする。
57 .TP 
58 \fBshm_unlink\fP(3)
59 共有メモリオブジェクト名を削除する。
60 .TP 
61 \fBclose\fP(2)
62 \fBshm_open\fP(3)  で割り当てられたファイルディスクリプタが不要になった際に、 そのファイルディスクリプタをクローズする。
63 .TP 
64 \fBfstat\fP(2)
65 その共有メモリオブジェクトについての情報が入った \fIstat\fP 構造体を取得する。 このシステムコールが返す情報には、オブジェクトのサイズ
66 (\fIst_size\fP)、 許可属性 (\fIst_mode\fP)、 所有者 (\fIst_uid\fP)、 グループ (\fIst_gid\fP)  がある。
67 .TP 
68 \fBfchown\fP(2)
69 共有メモリオブジェクトの所有権を変更する。
70 .TP 
71 \fBfchmod\fP(2)
72 共有メモリオブジェクトの許可属性を変更する。
73 .SS Versions
74 POSIX 共有メモリは Linux 2.4 と glibc 2.2 以降でサポートされている。
75 .SS 持続性
76 POSIX 共有メモリオブジェクトはカーネル内で保持される。 共有メモリオブジェクトは、システムがシャットダウンされるか、
77 全てのプロセスがそのオブジェクトをアンマップし、 \fBshm_unlink\fP(3)  で削除されるまで、存在し続ける。
78 .SS リンク
79 POSIX 共有メモリ API を使用したプログラムは \fIcc \-lrt\fP でコンパイルし、リアルタイムライブラリ \fIlibrt\fP
80 とリンクしなければならない。
81 .SS ファイルシステム経由での共有メモリオブジェクトへのアクセス
82 Linux では、共有メモリオブジェクトは通常 \fI/dev/shm\fP 以下にマウントされる仮想ファイルシステム (\fItmpfs\fP)
83 内に作成される。 カーネル 2.6.19 以降の Linux では、 仮想ファイルシステム内のオブジェクトの許可属性の制御に、 アクセス制御リスト
84 (ACL; access control lists) を使うことができる。
85 .SH 準拠
86 POSIX.1\-2001.
87 .SH 注意
88 通常は、共有メモリオブジェクトにアクセスするプロセスは、 POSIX セマフォなどを使ってプロセス間で同期をとらなければならない。
89
90 System V 共有メモリ (\fBshmget\fP(2), \fBshmop\fP(2)  など) は古い共有メモリ API である。 POSIX
91 共有メモリは、より簡単で、うまく設計されたインタフェースを提供している。 一方で、POSIX 共有メモリは System V 共有メモリと比べると
92 利用できるシステムが少ない (特に、古いシステムでは少ない)。
93 .SH 関連項目
94 \fBfchmod\fP(2), \fBfchown\fP(2), \fBfstat\fP(2), \fBftruncate\fP(2), \fBmmap\fP(2),
95 \fBmprotect\fP(2), \fBmunmap\fP(2), \fBshmget\fP(2), \fBshmop\fP(2), \fBshm_open\fP(3),
96 \fBshm_unlink\fP(3), \fBsem_overview\fP(7)
97 .SH この文書について
98 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
99 である。プロジェクトの説明とバグ報告に関する情報は
100 http://www.kernel.org/doc/man\-pages/ に書かれている。