OSDN Git Service

(split) LDP: Update release pages based on LDP 3.54 release
[linuxjm/LDP_man-pages.git] / release / man3 / getcwd.3
index ae5e9d1..fed0787 100644 (file)
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
+.\"
+.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka
+.\"         all rights reserved.
+.\" Translated Fri Feb 14 12:40:22 JST 1997
+.\"         by IMAMURA Nobutaka <imamura@spp.hpc.fujitsu.co.jp>
+.\" Modified Thu Dec 8 05:08:44 JST 1999
+.\"        by Kentaro Shirakata <argrath@yo.rim.or.jp>
+.\" Modified Sun Mar 12 21:08:44 JST 2000
+.\"        by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated 2001-01-29 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-03-23 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2002-10-17 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2007-01-01 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.07
+.\"
 .TH GETCWD 3 2010\-09\-20 GNU "Linux Programmer's Manual"
 .SH 名前
 getcwd, getwd, get_current_dir_name \- カレントワーキングディレクトリ名の取得
@@ -93,12 +108,14 @@ POSIX.1\-2001 標準の拡張として、 Linux (libc4, libc5, glibc) では \fI
 \fBmalloc\fP(3)  で獲得する。環境変数 \fBPWD\fP が設定されておりその値が正しければ、その値が返される。 呼び出し側で、返されたバッファを
 \fBfree\fP(3)  すべきである。
 
-\fBgetwd\fP()  は \fBmalloc\fP(3)  によるメモリ獲得を一切行なわない。 \fIbuf\fP 引数は少なくとも \fBPATH_MAX\fP
-バイトの長さを持つ配列へのポインタである必要がある。 終端の NULL バイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが
-\fBPATH_MAX\fP バイトを超えている場合、 NULL が返され、 \fIerrno\fP に \fBENAMETOOLONG\fP が設定される。
-(システムによっては、 \fBPATH_MAX\fP は必ずしもコンパイル時に決まる定数ではない点に注意すること。
-また、ファイルシステムに依存する場合もある。 \fBpathconf\fP(3)  を参照。)  移植性とセキュリティ上の理由から、 \fBgetwd\fP()
-の利用は推奨されない。
+\fBgetwd\fP()  does not \fBmalloc\fP(3)  any memory.  The \fIbuf\fP argument should
+be a pointer to an array at least \fBPATH_MAX\fP bytes long.  If the length of
+the absolute pathname of the current working directory, including the
+terminating null byte, exceeds \fBPATH_MAX\fP bytes, NULL is returned, and
+\fIerrno\fP is set to \fBENAMETOOLONG\fP.  (Note that on some systems, \fBPATH_MAX\fP
+may not be a compile\-time constant; furthermore, its value may depend on the
+filesystem, see \fBpathconf\fP(3).)  For portability and security reasons, use
+of \fBgetwd\fP()  is deprecated.
 .SH 返り値
 成功すると、これらの関数はカレントワーキングディレクトリの絶対パス名 が入った文字列へのポインタを返す。 \fBgetcwd\fP()  と
 \fBgetwd\fP()  の場合、返り値は \fIbuf\fP と同じ値になる。
@@ -137,9 +154,10 @@ POSIX.1\-2001 標準の拡張として、 Linux (libc4, libc5, glibc) では \fI
 
 \fBget_current_dir_name\fP()  は GNU 拡張である。
 .SH 注意
-Linux では (2.1.92 以降)、 \fBgetcwd\fP()  はシステムコールである。 古いシステムでは \fI/proc/self/cwd\fP
-を参照する。 システムコールも proc ファイルシステムもない場合、 一般的な実装が呼び出される。 この場合においてのみ、(Linux では)
-この関数は \fBEACCES\fP で失敗する可能性がある。
+Under Linux, the function \fBgetcwd\fP()  is a system call (since 2.1.92).  On
+older systems it would query \fI/proc/self/cwd\fP.  If both system call and
+proc filesystem are missing, a generic implementation is called.  Only in
+that case can these calls fail under Linux with \fBEACCES\fP.
 .LP
 これらの関数はしばしばカレントワーキングディレクトリの位置を保存し、 後で戻ってくるために利用される。 未使用のファイルディスクリプタが十分ある場合は、
 現在のディレクトリ (".") を開いて \fBfchdir\fP(2)  を呼び出すほうが普通は高速で信頼性がある。 特に Linux
@@ -148,6 +166,6 @@ Linux では (2.1.92 以降)、 \fBgetcwd\fP()  はシステムコールであ
 \fBchdir\fP(2), \fBfchdir\fP(2), \fBopen\fP(2), \fBunlink\fP(2), \fBfree\fP(3),
 \fBmalloc\fP(3)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。