OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / release / man3 / getcwd.3
diff --git a/release/man3/getcwd.3 b/release/man3/getcwd.3
deleted file mode 100644 (file)
index c6a7db5..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
-.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" Permission is granted to make and distribute verbatim copies of this
-.\" manual provided the copyright notice and this permission notice are
-.\" preserved on all copies.
-.\"
-.\" Permission is granted to copy and distribute modified versions of this
-.\" manual under the conditions for verbatim copying, provided that the
-.\" entire resulting derived work is distributed under the terms of a
-.\" permission notice identical to this one.
-.\"
-.\" Since the Linux kernel and libraries are constantly changing, this
-.\" manual page may be incorrect or out-of-date.  The author(s) assume no
-.\" responsibility for errors or omissions, or for damages resulting from
-.\" the use of the information contained herein.  The author(s) may not
-.\" have taken the same level of care in the production of this manual,
-.\" which is licensed free of charge, as they might when working
-.\" professionally.
-.\"
-.\" Formatted or processed versions of this manual, if unaccompanied by
-.\" the source, must acknowledge the copyright and authors of this work.
-.\" %%%LICENSE_END
-.\"
-.\" Modified Wed Jul 21 22:35:42 1993 by Rik Faith (faith@cs.unc.edu)
-.\" Modified 18 Mar 1996 by Martin Schulze (joey@infodrom.north.de):
-.\"   Corrected description of getwd().
-.\" Modified Sat Aug 21 12:32:12 MET 1999 by aeb - applied fix by aj
-.\" Modified Mon Dec 11 13:32:51 MET 2000 by aeb
-.\" Modified Thu Apr 22 03:49:15 CEST 2002 by Roger Luethi <rl@hellgate.ch>
-.\"
-.\"*******************************************************************
-.\"
-.\" 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 2014\-08\-19 GNU "Linux Programmer's Manual"
-.SH 名前
-getcwd, getwd, get_current_dir_name \- カレントワーキングディレクトリ名の取得
-.SH 書式
-.nf
-\fB#include <unistd.h>\fP
-.sp
-\fBchar *getcwd(char *\fP\fIbuf\fP\fB, size_t \fP\fIsize\fP\fB);\fP
-.sp
-\fBchar *getwd(char *\fP\fIbuf\fP\fB);\fP
-.sp
-\fBchar *get_current_dir_name(void);\fP
-.fi
-.sp
-.in -4n
-glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
-.sp
-.in
-\fBget_current_dir_name\fP():
-.RS
-_GNU_SOURCE
-.RE
-.sp
-\fBgetwd\fP():
-.ad l
-.RS 4
-.PD 0
-.TP  4
-glibc 2.12 以降:
-.nf
-_BSD_SOURCE ||
-    (_XOPEN_SOURCE\ >=\ 500 ||
-        _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
-    !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
-.TP  4
-.fi
-glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
-.PD
-.RE
-.ad b
-.SH 説明
-これらの関数は、呼び出したプロセスのカレントワーキングディレクトリの 絶対パス名 (absolute pathname) が入った文字列を返す。
-返される文字列はヌルで終端される。 パス名は関数の結果として返され、引数 \fIbuf\fP がある場合は \fIbuf\fP 経由でも返される。
-
-\fBgetcwd\fP()  関数はカレントワーキングディレクトリの絶対パス名を \fIbuf\fP で示された \fIsize\fP 長の配列にコピーする。
-.PP
-終端のヌルバイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが \fIsize\fP バイトを超えている場合は、返り値として NULL が返り
-\fIerrno\fP に \fBERANGE\fP がセットされる。 アプリケーションはこのエラーをチェックし、
-必要に応じてより長いバッファーを用意すべきである。
-.PP
-POSIX.1\-2001 標準の拡張として、 glibc では \fIbuf\fP が NULL の場合、 \fBgetcwd\fP()  は必要なバッファーを
-\fBmalloc\fP(3)  を用いて動的に割り当てる。 この場合、 \fIsize\fP が 0 の場合を除き、バッファーの長さは \fIsize\fP となる。
-\fIsize\fP が 0 の場合には必要な大きさが確保される。 呼び出し側で、返されたバッファーを \fBfree\fP(3)  すべきである。
-
-\fBget_current_dir_name\fP()  はカレントワーキングディレクトリの絶対パス名を収めるのに 十分な大きさの配列を
-\fBmalloc\fP(3)  で獲得する。環境変数 \fBPWD\fP が設定されておりその値が正しければ、その値が返される。
-呼び出し側で、返されたバッファーを \fBfree\fP(3)  すべきである。
-
-\fBgetwd\fP()  は \fBmalloc\fP(3)  によるメモリー獲得を一切行なわない。 \fIbuf\fP 引数は少なくとも \fBPATH_MAX\fP
-バイトの長さを持つ配列へのポインターである必要がある。 終端のヌルバイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが
-\fBPATH_MAX\fP バイトを超えている場合、 NULL が返され、 \fIerrno\fP に \fBENAMETOOLONG\fP が設定される。
-(システムによっては、 \fBPATH_MAX\fP は必ずしもコンパイル時に決まる定数ではない点に注意すること。
-また、ファイルシステムに依存する場合もある。 \fBpathconf\fP(3)  を参照。)  移植性とセキュリティ上の理由から、 \fBgetwd\fP()
-の利用は推奨されない。
-.SH 返り値
-成功すると、これらの関数はカレントワーキングディレクトリの絶対パス名 が入った文字列へのポインターを返す。 \fBgetcwd\fP()  と
-\fBgetwd\fP()  の場合、返り値は \fIbuf\fP と同じ値になる。
-
-失敗した場合、これらの関数は NULL を返し、 \fIerrno\fP にエラーを示す値を設定する。 \fIbuf\fP が指す配列の内容は未定義である。
-.SH エラー
-.TP 
-\fBEACCES\fP
-ファイル名の構成要素に対する読み込みあるいは検索の権限がない。
-.TP 
-\fBEFAULT\fP
-\fIbuf\fP が不正なアドレスを指している。
-.TP 
-\fBEINVAL\fP
-\fIsize\fP 引数が 0 かつ、 \fIbuf\fP 引数がヌルポインターでない。
-.TP 
-\fBEINVAL\fP
-\fBgetwd\fP(): \fIbuf\fP が NULL である。
-.TP 
-\fBENAMETOOLONG\fP
-\fBgetwd\fP(): 絶対パス名が入ったヌル終端された文字列の長さが \fBPATH_MAX\fP バイトを超えている。
-.TP 
-\fBENOENT\fP
-カレントワーキングディレクトリが削除されている。
-.TP 
-\fBERANGE\fP
-\fIsize\fP 引数の値がワーキングディレクトリの絶対パス名の長さより小さい。 長さには文字列の終端バイトも含まれる。
-より大きい配列を確保してもう一度実行する必要がある。
-.SH 準拠
-\fBgetcwd\fP()  は POSIX.1\-2001 に準拠している。 POSIX.1\-2001 は、 \fIbuf\fP が NULL の場合の
-\fBgetcwd\fP()  の動作を規定しないままとしている。
-
-\fBgetwd\fP()  は POSIX.1\-2001 に存在しているが、「過去の名残(LEGACY)」とされている。 POSIX.1\-2008 では、
-\fBgetwd\fP()  の仕様が削除されている。 代わりに \fBgetcwd\fP()  を使うこと。 POSIX.1\-2001 は \fBgetwd\fP()
-に関するエラーを定義していない。
-
-\fBget_current_dir_name\fP()  は GNU 拡張である。
-.SH 注意
-Linux では (2.1.92 以降)、 \fBgetcwd\fP()  はシステムコールである。 古いシステムでは \fI/proc/self/cwd\fP
-を参照する。 システムコールも proc ファイルシステムもない場合、 一般的な実装が呼び出される。 この場合においてのみ、(Linux では)
-この関数は \fBEACCES\fP で失敗する可能性がある。
-.LP
-これらの関数はしばしばカレントワーキングディレクトリの位置を保存し、 後で戻ってくるために利用される。
-未使用のファイルディスクリプターが十分ある場合は、 現在のディレクトリ (".") を開いて \fBfchdir\fP(2)
-を呼び出すほうが普通は高速で信頼性がある。 特に Linux 以外のプラットフォームの場合はそうである。
-.SH 関連項目
-\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.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。