1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
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>
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
41 .TH CHDIR 2 2010-09-26 "Linux" "Linux Programmer's Manual"
43 chdir, fchdir \- 作業ディレクトリの変更
45 .B #include <unistd.h>
47 .BI "int chdir(const char *" path );
49 .BI "int fchdir(int " fd );
53 .RB ( feature_test_macros (7)
61 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
62 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
64 || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L
70 は、呼び出し元プロセスの現在の作業ディレクトリ (current working directory) を、
75 は、ディレクトリがオープンされたファイル・ディスクリプターとして
80 成功すると、0 を返す。失敗すると、\-1 を返し、
84 ファイルシステムによっては他のエラーが返される事がある。
90 の構成要素のいずれかに検索許可 (search permission) がない
91 .RB ( path_resolution (7)
104 を解決する際に遭遇したシンボリック・リンクが多過ぎる。
125 をディレクトリとしてオープンするための検索許可がない。
129 が適切なファイル・ディスクリプターでない。
131 SVr4, 4.4BSD, POSIX.1-2001.
133 現在の作業ディレクトリは、相対パス名 (\(aq/\(aq) で始まっていないパス名) を
137 で作成された子プロセスは、親プロセスの現在の作業ディレクトリを
140 の前後で、現在の作業ディレクトリは変更されない。
151 .BR path_resolution (7)