"posix" — 最も一般的な POSIX システムコール群
*********************************************

このモジュールはオペレーティングシステムの機能のうち、C 言語標準および
(Unix インタフェースをほんの少し隠蔽した) POSIX 標準で標準化されている
機能に対するアクセス機構を提供します。

**このモジュールを直接インポートしてはいけません。** その代わりに、こ
のインターフェースの *ポータブル* 版である "os" モジュールをインポート
してください。 Unix では、"os" モジュールは "posix" インターフェースの
スーパーセットを提供しています。非 Unix オペレーティングシステムでは、
"posix" モジュールは利用できませんが、その一部分は "os" インターフェー
スを通して常に利用可能です。一度 "os" をインポートし "posix" の代わり
にそれを使えば、パフォーマンス上の代償は *ありません* 。加えて "os" は
、 "os.environ" の要素が変更されたときに "putenv()" を呼び出すなどの追
加の機能も提供します。

エラーは例外として報告されます; よくある例外は型エラーです。一方、シス
テムコールから報告されたエラーは以下に述べるように "OSError" を送出し
ます。


ラージファイルのサポート
========================

Several operating systems (including AIX, HP-UX, Irix and Solaris)
provide support for files that are larger than 2 GB from a C
programming model where "int" and "long" are 32-bit values. This is
typically accomplished by defining the relevant size and offset types
as 64-bit values. Such files are sometimes referred to as *large
files*.

Large file support is enabled in Python when the size of an "off_t" is
larger than a "long" and the "long long" type is available and is at
least as large as an "off_t". Python longs are then used to represent
file sizes, offsets and other values that can exceed the range of a
Python int. It may be necessary to configure and compile Python with
certain compiler flags to enable this mode. For example, it is enabled
by default with recent versions of Irix, but with Solaris 2.6 and 2.7
you need to do something like:

   CFLAGS="`getconf LFS_CFLAGS`" OPT="-g -O2 $CFLAGS" \
           ./configure

ラージファイル対応の Linux システムでは、以下のようにすれば良いでしょ
う:

   CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS" \
           ./configure


注目すべきモジュールの内容
==========================

"os" モジュールのドキュメントで説明されている多数の関数に加え、
"posix" では以下のデータ項目を定義しています:

posix.environ

   A dictionary representing the string environment at the time the
   interpreter was started.  For example, "environ['HOME']" is the
   pathname of your home directory, equivalent to "getenv("HOME")" in
   C.

   この辞書を編集しても、 "execv()" 、 "popen()" 、 "system()" で渡さ
   れた環境変数文字列には影響は与えません; 環境変数を変更したい場合は
   、 "environ" を "execve()" に渡すか、変数への代入文と export 文を
   "system()" や "popen()" に渡すコマンド文字列に追加してください。

   注釈: The "os" module provides an alternate implementation of
     "environ" which updates the environment on modification.  Note
     also that updating "os.environ" will render this dictionary
     obsolete.  Use of the "os" module version of this is recommended
     over direct access to the "posix" module.
