.\" Copyright (c) 1993 Michael Haardt .\" (michael@moria.de) .\" Fri Apr 2 11:32:09 MET DST 1993 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" Modified Sat Jul 24 15:12:05 1993 by Rik Faith .\" Modified Tue Aug 1 16:27 1995 by Jochen Karrer .\" .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond .\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HORIMOTO Masafumi .\" all rights reserved. .\" Translated 1997-09-11, HORIMOTO Masafumi .\" Modified 1999-04-03, HANATAKA Shinya .\" Updated 2003-10-12, Kentaro Shirakata .\" Updated 2005-02-24, Akihiro MOTOKI .\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43 .\" Updated 2013-05-01, Akihiro MOTOKI .\" .TH IOPERM 2 2013\-03\-12 Linux "Linux Programmer's Manual" .SH 名前 ioperm \- ポートの入出力許可を設定する .SH 書式 \fB#include \fP /* for libc5 */ .br \fB#include \fP /* for glibc */ .sp \fBint ioperm(unsigned long \fP\fIfrom\fP\fB, unsigned long \fP\fInum\fP\fB, int \fP\fIturn_on\fP\fB);\fP .SH 説明 \fBioperm\fP() は、引き数 \fIfrom\fP の I/O ポートアドレスから \fInum\fP ビット分の領域に対する、呼び出し元スレッドのアクセス許可ビットを設定する。 \fIturn_on\fP が 0 以外の場合、指定されたビットに対応する許可が有効になる。 \fIturn_on\fP が 0 以外の場合、呼び出し元プロセスは特権 (\fBCAP_SYS_RAWIO\fP) を持っていなければならない。 Linux 2.6.8 より前のバージョンでは、この方法で設定できるのは 0x3ff 番地までの I/Oポートに限られていた。これよりも大きなアドレスのポートに対しては \fBiopl\fP(2) 関数を使わなければならなかった。Linux 2.6.8 以降では、65,536 個の I/O ポートを指定できる。 アクセス権は \fBfork\fP(2) で作成された子プロセスには継承されない。子プロセスでは、\fBfork\fP(2) の後で必要なアクセス権を有効にしなければならない。 \fBexecve\fP(2) の前後でアクセス権は保存される。この機能は 非特権プログラムにポートへのアクセス権を 与えるのに使用できる。 このシステムコールはほとんど i386 アーキテクチャのためだけのものである。 その他の多くのアーキテクチャでは存在しないか、常にエラーを返す。 .SH 返り値 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEINVAL\fP \fIfrom\fP または \fInum\fP の値が不正である。 .TP \fBEIO\fP (PowerPC で) このシステムコールはサポートしていない。 .TP \fBENOMEM\fP .\" Could not allocate I/O bitmap. メモリ不足。 .TP \fBEPERM\fP 呼び出し元スレッドに十分な権限がなかった。 .SH 準拠 \fBioperm\fP() は Linux 特有の関数であり、移植を意図したプログラムで 使用してはならない。 .SH 注意 \fI/proc/ioports\fP ファイルには、現在このシステムに割り当てられている I/O ポートが表示される。 libc5 ではシステムコールとして扱い \fI\fP にプロトタイプが存在している。 glibc1 にはプロトタイプは存在しない。 glibc2 は \fI\fP と \fI\fP の両方にプロトタイプを持っている。 後者は i386 のみで利用可能なので、使用すべきではない。 .SH 関連項目 \fBiopl\fP(2), \fBoutb\fP(2), \fBcapabilities\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。