.\"
.TH CHDIR 2 2010-09-26 "Linux" "Linux Programmer's Manual"
.\"O .SH NAME
-.SH ̾Á°
+.SH 名前
.\"O chdir, fchdir \- change working directory
-chdir, fchdir \- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹
+chdir, fchdir \- 作業ディレクトリの変更
.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.SH 書式
.B #include <unistd.h>
.sp
.BI "int chdir(const char *" path );
.in -4n
.\"O Feature Test Macro Requirements for glibc (see
.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
+glibc 向けの機能検査マクロの要件
.RB ( feature_test_macros (7)
-»²¾È):
+参照):
.in
.sp
.BR fchdir ():
_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
.br
.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
-|| /* glibc 2.12 °Ê¹ß: */ _POSIX_C_SOURCE\ >=\ 200809L
+|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L
.RE
.ad
.PD
.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
+.SH 説明
.\"O .BR chdir ()
.\"O changes the current working directory of the calling process to the
.\"O directory specified in
.\"O .IR path .
.BR chdir ()
-¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê (current working directory) ¤ò¡¢
+は、呼び出し元プロセスの現在の作業ディレクトリ (current working directory) を、
.I path
-¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£
+に指定されたディレクトリに変更する。
.PP
.\"O .BR fchdir ()
.\"O is identical to
.\"O the only difference is that the directory is given as an
.\"O open file descriptor.
.BR fchdir ()
-¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤Æ
-»ØÄꤵ¤ì¤ë°Ê³°¤Ï¡¢
+は、ディレクトリがオープンされたファイル・ディスクリプターとして
+指定される以外は、
.BR chdir ()
-¤ÈƱ¤¸¤Ç¤¢¤ë¡£
+と同じである。
.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
+.SH 返り値
.\"O On success, zero is returned.
.\"O On error, \-1 is returned, and
.\"O .I errno
.\"O is set appropriately.
-À®¸ù¤¹¤ë¤È¡¢0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È¡¢\-1 ¤òÊÖ¤·¡¢
+成功すると、0 を返す。失敗すると、\-1 を返し、
.I errno
-¤ËŬÀÚ¤ÊÃͤò¥»¥Ã¥È¤¹¤ë¡£
+に適切な値をセットする。
.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
+.SH ã\82¨ã\83©ã\83¼
.\"O Depending on the file system, other errors can be returned.
.\"O The more
.\"O general errors for
.\"O .BR chdir ()
.\"O are listed below:
-¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£
+ファイルシステムによっては他のエラーが返される事がある。
.BR chdir ()
-¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
+で一般的なエラーを以下に挙げる:
.TP
.B EACCES
.\"O Search permission is denied for one of the components of
.\"O (See also
.\"O .BR path_resolution (7).)
.I path
-¤Î¹½À®Í×ÁǤΤ¤¤º¤ì¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤
+の構成要素のいずれかに検索許可 (search permission) がない
.RB ( path_resolution (7)
-¤â»²¾È¤¹¤ë¤³¤È)¡£
+も参照すること)。
.TP
.B EFAULT
.\"O .I path
.\"O points outside your accessible address space.
-³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò
+割り当てられたアドレス空間外を
.I path
-¤¬»Ø¤·¤Æ¤¤¤ë¡£
+が指している。
.TP
.B EIO
.\"O An I/O error occurred.
-I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
+I/O エラーが発生した。
.TP
.B ELOOP
.\"O Too many symbolic links were encountered in resolving
.\"O .IR path .
.I path
-¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
+を解決する際に遭遇したシンボリック・リンクが多過ぎる。
.TP
.B ENAMETOOLONG
.\"O .I path
.\"O is too long.
.I path
-¤¬Ä¹²á¤®¤ë¡£
+が長過ぎる。
.TP
.B ENOENT
.\"O The file does not exist.
.\"Osato:
-.\"Osato: file ¤Ç¤Ï¤Ê¤¯ directory ¤Î´Ö°ã¤¤¤«?
+.\"Osato: file ではなく directory の間違いか?
.\"Osato:
-¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸ºß¤·¤Ê¤¤¡£
+そのディレクトリは存在しない。
.TP
.B ENOMEM
.\"O Insufficient kernel memory was available.
-¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
+カーネルに十分なメモリがない。
.TP
.B ENOTDIR
.\"O A component of
.\"O .I path
.\"O is not a directory.
.I path
-¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£
+の構成要素がディレクトリではない。
.PP
.\"O The general errors for
.\"O .BR fchdir ()
.\"O are listed below:
.BR fchdir ()
-¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
+で一般的なエラーを以下に挙げる:
.TP
.B EACCES
.\"O Search permission was denied on the directory open on
.\"O .IR fd .
.I fd
-¤ò¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤¿¤á¤Î¸¡º÷µö²Ä¤¬¤Ê¤¤¡£
+をディレクトリとしてオープンするための検索許可がない。
.TP
.B EBADF
.\"O .I fd
.\"O is not a valid file descriptor.
.I fd
-¤¬Å¬Àڤʥե¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£
+が適切なファイル・ディスクリプターでない。
.\"O .SH "CONFORMING TO"
-.SH ½àµò
+.SH 準拠
SVr4, 4.4BSD, POSIX.1-2001.
.\"O .SH NOTES
-.SH Ãí°Õ
+.SH 注意
.\"O The current working directory is the starting point for interpreting
.\"O relative pathnames (those not starting with \(aq/\(aq)).
-¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÁêÂХѥ¹Ì¾ (\(aq/\(aq) ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¥Ñ¥¹Ì¾) ¤ò
-²ò¼á¤¹¤ëºÝ¤Î³«»ÏÅÀ¤Ç¤¢¤ë¡£
+現在の作業ディレクトリは、相対パス名 (\(aq/\(aq) で始まっていないパス名) を
+解釈する際の開始点である。
.\"O A child process created via
.\"O .BR fork (2)
.\"O The current working directory is left unchanged by
.\"O .BR execve (2).
.BR fork (2)
-¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò
-·Ñ¾µ¤¹¤ë¡£
+で作成された子プロセスは、親プロセスの現在の作業ディレクトリを
+継承する。
.BR execve (2)
-¤ÎÁ°¸å¤Ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
+の前後で、現在の作業ディレクトリは変更されない。
.\"O The prototype for
.\"O .BR fchdir ()
.\"O .B _XOPEN_SOURCE
.\"O is defined with the value 500.
.BR fchdir ()
-¤Î¥×¥í¥È¥¿¥¤¥×¤¬Í¸ú¤Ë¤Ê¤ë¤Î¤Ï¡¢
+のプロトタイプが有効になるのは、
.B _BSD_SOURCE
-¤òÄêµÁ¤·¤¿¾ì¹ç¤«¡¢
+を定義した場合か、
.B _XOPEN_SOURCE
-¤òÃÍ 500 ¤ÇÄêµÁ¤·¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£
+を値 500 で定義した場合のみである。
.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.SH 関連項目
.BR chroot (2),
.BR getcwd (3),
.BR path_resolution (7)