OSDN Git Service

de226a7fa3885327e9a243eef5ca45e86953b0aa
[linuxjm/LDP_man-pages.git] / draft / man2 / ioperm.2
1 .\" Copyright (c) 1993 Michael Haardt
2 .\" (michael@moria.de)
3 .\" Fri Apr  2 11:32:09 MET DST 1993
4 .\"
5 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
10 .\"
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
15 .\"
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 .\" GNU General Public License for more details.
20 .\"
21 .\" You should have received a copy of the GNU General Public
22 .\" License along with this manual; if not, see
23 .\" <http://www.gnu.org/licenses/>.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified Sat Jul 24 15:12:05 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified Tue Aug  1 16:27    1995 by Jochen Karrer
28 .\"                              <cip307@cip.physik.uni-wuerzburg.de>
29 .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer <aeb@cwi.nl>
31 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
32 .\"     Added notes on capability requirements
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" This file was generated with po4a. Translate the source file.
37 .\"
38 .\"*******************************************************************
39 .TH IOPERM 2 2013\-03\-12 Linux "Linux Programmer's Manual"
40 .SH 名前
41 ioperm \- ポートの入出力許可を設定する
42 .SH 書式
43 \fB#include <unistd.h>\fP /* for libc5 */
44 .br
45 \fB#include <sys/io.h>\fP /* for glibc */
46 .sp
47 \fBint ioperm(unsigned long \fP\fIfrom\fP\fB, unsigned long \fP\fInum\fP\fB, int
48 \fP\fIturn_on\fP\fB);\fP
49 .SH 説明
50 \fBioperm\fP()  は、引き数 \fIfrom\fP の I/O ポートアドレスから \fInum\fP
51 ビット分の領域に対する、呼び出し元スレッドのアクセス許可ビットを設定する。 \fIturn_on\fP が 0
52 以外の場合、指定されたビットに対応する許可が有効になる。 \fIturn_on\fP が 0 以外の場合、呼び出し元プロセスは特権
53 (\fBCAP_SYS_RAWIO\fP)  を持っていなければならない。
54
55 Linux 2.6.8 より前のバージョンでは、この方法で設定できるのは 0x3ff 番地までの
56 I/Oポートに限られていた。これよりも大きなアドレスのポートに対しては \fBiopl\fP(2) 関数を使わなければならなかった。Linux 2.6.8
57 以降では、65,536 個の I/O ポートを指定できる。
58
59 アクセス権は \fBfork\fP(2)  で作成された子プロセスには継承されない。子プロセスでは、\fBfork\fP(2)
60 の後で必要なアクセス権を有効にしなければならない。 \fBexecve\fP(2)  の前後でアクセス権は保存される。この機能は
61 非特権プログラムにポートへのアクセス権を 与えるのに使用できる。
62
63 このシステムコールはほとんど i386 アーキテクチャのためだけのものである。 その他の多くのアーキテクチャでは存在しないか、常にエラーを返す。
64 .SH 返り値
65 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
66 .SH エラー
67 .TP 
68 \fBEINVAL\fP
69 \fIfrom\fP または \fInum\fP の値が不正である。
70 .TP 
71 \fBEIO\fP
72 (PowerPC で) このシステムコールはサポートしていない。
73 .TP 
74 \fBENOMEM\fP
75 .\" Could not allocate I/O bitmap.
76 メモリ不足。
77 .TP 
78 \fBEPERM\fP
79 呼び出し元スレッドに十分な権限がなかった。
80 .SH 準拠
81 \fBioperm\fP()  は Linux 特有の関数であり、移植を意図したプログラムで 使用してはならない。
82 .SH 注意
83 \fI/proc/ioports\fP ファイルには、現在このシステムに割り当てられている I/O ポートが表示される。
84
85 libc5 ではシステムコールとして扱い \fI<unistd.h>\fP にプロトタイプが存在している。 glibc1
86 にはプロトタイプは存在しない。 glibc2 は \fI<sys/io.h>\fP と \fI<sys/perm.h>\fP
87 の両方にプロトタイプを持っている。 後者は i386 のみで利用可能なので、使用すべきではない。
88 .SH 関連項目
89 \fBiopl\fP(2), \fBoutb\fP(2), \fBcapabilities\fP(7)
90 .SH この文書について
91 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
92 である。プロジェクトの説明とバグ報告に関する情報は
93 http://www.kernel.org/doc/man\-pages/ に書かれている。