124 lines
3.9 KiB
Groff
124 lines
3.9 KiB
Groff
.\" Copyright (c) 1980, 1991, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)chdir.2 8.2 (Berkeley) 12/11/93
|
|
.\" %FreeBSD: src/lib/libc/sys/chdir.2,v 1.15 2002/12/19 09:40:24 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd December 11, 1993
|
|
.Dt CHDIR 2
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm chdir ,
|
|
.Nm fchdir
|
|
.Nd ¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libc
|
|
.Sh ½ñ¼°
|
|
.In unistd.h
|
|
.Ft int
|
|
.Fn chdir "const char *path"
|
|
.Ft int
|
|
.Fn fchdir "int fd"
|
|
.Sh ²òÀâ
|
|
.Fa path
|
|
°ú¿ô¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾¤ò»Ø¤·¤Þ¤¹¡£
|
|
.Fn chdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¡¢»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬
|
|
¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¡¢¤¹¤Ê¤ï¤Á¥¹¥é¥Ã¥·¥å
|
|
.Ql /
|
|
¤Ç³«»Ï¤·¤Ê¤¤¥Ñ¥¹Ì¾¤Î¥Ñ¥¹¸¡º÷¤Î³«»ÏÅÀ¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn fchdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¡¢
|
|
.Fa fd
|
|
¤¬»²¾È¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤¬
|
|
¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê (¥¹¥é¥Ã¥·¥å
|
|
.Ql /
|
|
¤Ç³«»Ï¤·¤Ê¤¤¥Ñ¥¹Ì¾¤Î¥Ñ¥¹¸¡º÷¤Î³«»ÏÅÀ) ¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
¥Ç¥£¥ì¥¯¥È¥ê¤¬¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ë¤¿¤á¤Ë¤Ï¡¢
|
|
¥×¥í¥»¥¹¤¬¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î
|
|
¼Â¹Ô (¸¡º÷) ¥¢¥¯¥»¥¹µö²Ä¤ò»ý¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
.Rv -std
|
|
.Sh ¥¨¥é¡¼
|
|
¼¡¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤¬¿¿¤Î¾ì¹ç¡¢
|
|
.Fn chdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î½èÍý¤Ï¼ºÇÔ¤·¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó:
|
|
.Bl -tag -width Er
|
|
.It Bq Er ENOTDIR
|
|
¥Ñ¥¹¤Î¹½À®Í×ÁÇÃæ¤Ë¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¤â¤Î¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.It Bq Er ENAMETOOLONG
|
|
¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤ¬ 255 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤ë¤«¡¢
|
|
¤Þ¤¿¤Ï¥Ñ¥¹Ì¾Á´ÂΤ¬ 1023 ʸ»ú¤ò±Û¤¨¤Æ¤¤¤Þ¤¹¡£
|
|
.It Bq Er ENOENT
|
|
»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£
|
|
.It Bq Er ELOOP
|
|
¥Ñ¥¹Ì¾¤òÊÑ´¹¤¹¤ë¤È¤¤Ë¸¡½Ð¤µ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿¤¹¤®¤Þ¤¹¡£
|
|
.It Bq Er EACCES
|
|
¥Ñ¥¹Ì¾¤Î¹½À®Í×ÁǤΤ¤¤º¤ì¤«¤Ç¡¢¸¡º÷¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
|
|
.It Bq Er EFAULT
|
|
.Fa path
|
|
°ú¿ô¤¬¡¢¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤ÎÈϰϳ°¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£
|
|
.It Bq Er EIO
|
|
¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÆÉ¤ß½ñ¤¤·¤Æ¤¤¤ë´Ö¤ËÆþ½ÐÎÏ¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£
|
|
.El
|
|
.Pp
|
|
¼¡¤Î¤¦¤Á 1 ¤Ä°Ê¾å¤¬¿¿¤Î¾ì¹ç¡¢
|
|
.Fn fchdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î½èÍý¤Ï¼ºÇÔ¤·¡¢¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó:
|
|
.Bl -tag -width Er
|
|
.It Bq Er EACCES
|
|
¥Õ¥¡¥¤¥ëµ½Ò»Ò¤¬»²¾È¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ç¸¡º÷¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
|
|
.It Bq Er ENOTDIR
|
|
¥Õ¥¡¥¤¥ëµ½Ò»Ò¤¬¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤·¤Æ¤¤¤Þ¤»¤ó¡£
|
|
.It Bq Er EBADF
|
|
°ú¿ô
|
|
.Fa fd
|
|
¤¬Í¸ú¤Ê¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
|
.El
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr chroot 2
|
|
.Sh µ¬³Ê
|
|
.Fn chdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
.St -p1003.1-90
|
|
¤ËŬ¹ç¤·¤Æ¤¤¤Þ¤¹¡£
|
|
.Sh Îò»Ë
|
|
.Fn chdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
.At v7
|
|
¤ÇÅо줷¤Þ¤·¤¿¡£
|
|
.Fn fchdir
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
.Bx 4.2
|
|
¤ÇÅо줷¤Þ¤·¤¿¡£
|