OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / chdir.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-21 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1995-04-15 by Michael Chastain <mec@shell.portal.com>:
28 .\"   Added 'fchdir'. Fixed bugs in error section.
29 .\" Modified 1996-10-21 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified 1997-08-21 by Joseph S. Myers <jsm28@cam.ac.uk>
31 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
32 .\"
33 .\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara
34 .\"         all rights reserved.
35 .\" Translated 1996-06-24, Yosiaki Yanagihara <yosiaki@bsd2.kbnes.nec.co.jp>
36 .\" Modified 1997-12-13, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
37 .\" Updated & Modified 2005-02-05, Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated 2006-08-12, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.39
39 .\" Updated 2007-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
40 .\"
41 .TH CHDIR 2 2007-07-26 "Linux" "Linux Programmer's Manual"
42 .\"O .SH NAME
43 .SH Ì¾Á°
44 .\"O chdir, fchdir \- change working directory
45 chdir, fchdir \- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹
46 .\"O .SH SYNOPSIS
47 .SH ½ñ¼°
48 .B #include <unistd.h>
49 .sp
50 .BI "int chdir(const char *" path );
51 .br
52 .BI "int fchdir(int " fd );
53 .sp
54 .in -4n
55 .\"O Feature Test Macro Requirements for glibc (see
56 .\"O .BR feature_test_macros (7)):
57 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
58 .RB ( feature_test_macros (7)
59 »²¾È):
60 .in
61 .sp
62 .BR fchdir ():
63 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
64 .\"O .SH DESCRIPTION
65 .SH ÀâÌÀ
66 .\"O .BR chdir ()
67 .\"O changes the current working directory of the calling process to the
68 .\"O directory specified in
69 .\"O .IR path .
70 .BR chdir ()
71 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê (current working directory) ¤ò¡¢
72 .I path
73 ¤Ë»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£
74 .PP
75 .\"O .BR fchdir ()
76 .\"O is identical to
77 .\"O .BR chdir ();
78 .\"O the only difference is that the directory is given as an
79 .\"O open file descriptor.
80 .BR fchdir ()
81 ¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤Æ
82 »ØÄꤵ¤ì¤ë°Ê³°¤Ï¡¢
83 .BR chdir ()
84 ¤ÈƱ¤¸¤Ç¤¢¤ë¡£
85 .\"O .SH "RETURN VALUE"
86 .SH ÊÖ¤êÃÍ
87 .\"O On success, zero is returned.
88 .\"O On error, \-1 is returned, and
89 .\"O .I errno
90 .\"O is set appropriately.
91 À®¸ù¤¹¤ë¤È¡¢0 ¤òÊÖ¤¹¡£¼ºÇÔ¤¹¤ë¤È¡¢\-1 ¤òÊÖ¤·¡¢
92 .I errno
93 ¤ËŬÀÚ¤ÊÃͤò¥»¥Ã¥È¤¹¤ë¡£
94 .\"O .SH ERRORS
95 .SH ¥¨¥é¡¼
96 .\"O Depending on the file system, other errors can be returned.
97 .\"O The more
98 .\"O general errors for
99 .\"O .BR chdir ()
100 .\"O are listed below:
101 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£
102 .BR chdir ()
103 ¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
104 .TP
105 .B EACCES
106 .\"O Search permission is denied for one of the components of
107 .\"O .IR path .
108 .\"O (See also
109 .\"O .BR path_resolution (7).)
110 .I path
111 ¤Î¹½À®Í×ÁǤΤ¤¤º¤ì¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤
112 .RB ( path_resolution (7)
113 ¤â»²¾È¤¹¤ë¤³¤È)¡£
114 .TP
115 .B EFAULT
116 .\"O .I path
117 .\"O points outside your accessible address space.
118 ³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò
119 .I path
120 ¤¬»Ø¤·¤Æ¤¤¤ë¡£
121 .TP
122 .B EIO
123 .\"O An I/O error occurred.
124 I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
125 .TP
126 .B ELOOP
127 .\"O Too many symbolic links were encountered in resolving
128 .\"O .IR path .
129 .I path
130 ¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
131 .TP
132 .B ENAMETOOLONG
133 .\"O .I path
134 .\"O is too long.
135 .I path
136 ¤¬Ä¹²á¤®¤ë¡£
137 .TP
138 .B ENOENT
139 .\"O The file does not exist.
140 .\"Osato:
141 .\"Osato: file ¤Ç¤Ï¤Ê¤¯ directory ¤Î´Ö°ã¤¤¤«?
142 .\"Osato:
143 ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸ºß¤·¤Ê¤¤¡£
144 .TP
145 .B ENOMEM
146 .\"O Insufficient kernel memory was available.
147 ¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
148 .TP
149 .B ENOTDIR
150 .\"O A component of
151 .\"O .I path
152 .\"O is not a directory.
153 .I path
154 ¤Î¹½À®Í×ÁǤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£
155 .PP
156 .\"O The general errors for
157 .\"O .BR fchdir ()
158 .\"O are listed below:
159 .BR fchdir ()
160 ¤Ç°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
161 .TP
162 .B EACCES
163 .\"O Search permission was denied on the directory open on
164 .\"O .IR fd .
165 .I fd
166 ¤ò¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤¿¤á¤Î¸¡º÷µö²Ä¤¬¤Ê¤¤¡£
167 .TP
168 .B EBADF
169 .\"O .I fd
170 .\"O is not a valid file descriptor.
171 .I fd
172 ¤¬Å¬Àڤʥե¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤¤¡£
173 .\"O .SH "CONFORMING TO"
174 .SH ½àµò
175 SVr4, 4.4BSD, POSIX.1-2001.
176 .\"O .SH NOTES
177 .SH Ãí°Õ
178 .\"O The current working directory is the starting point for interpreting
179 .\"O relative pathnames (those not starting with \(aq/\(aq)).
180 ¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÁêÂХѥ¹Ì¾ (\(aq/\(aq) ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¤¥Ñ¥¹Ì¾) ¤ò
181 ²ò¼á¤¹¤ëºÝ¤Î³«»ÏÅÀ¤Ç¤¢¤ë¡£
182
183 .\"O A child process created via
184 .\"O .BR fork (2)
185 .\"O inherits its parent's current working directory.
186 .\"O The current working directory is left unchanged by
187 .\"O .BR execve (2).
188 .BR fork (2)
189 ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢¿Æ¥×¥í¥»¥¹¤Î¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò
190 ·Ñ¾µ¤¹¤ë¡£
191 .BR execve (2)
192 ¤ÎÁ°¸å¤Ç¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
193
194 .\"O The prototype for
195 .\"O .BR fchdir ()
196 .\"O is only available if
197 .\"O .B _BSD_SOURCE
198 .\"O is defined, or
199 .\"O .B _XOPEN_SOURCE
200 .\"O is defined with the value 500.
201 .BR fchdir ()
202 ¤Î¥×¥í¥È¥¿¥¤¥×¤¬Í­¸ú¤Ë¤Ê¤ë¤Î¤Ï¡¢
203 .B _BSD_SOURCE
204 ¤òÄêµÁ¤·¤¿¾ì¹ç¤«¡¢
205 .B _XOPEN_SOURCE
206 ¤òÃÍ 500 ¤ÇÄêµÁ¤·¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£
207 .\"O .SH "SEE ALSO"
208 .SH ´ØÏ¢¹àÌÜ
209 .BR chroot (2),
210 .BR getcwd (3),
211 .BR path_resolution (7)