74 lines
1.8 KiB
HTML
74 lines
1.8 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>chdir(2)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>chdir(2)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
chdir - change current working directory
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><unistd.h></STRONG>
|
|
|
|
<STRONG>int</STRONG> <STRONG>chdir(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>path</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<EM>Path</EM> is the pathname of a directory. <STRONG>Chdir</STRONG> causes this directory to
|
|
become the current working directory, the starting point for path names
|
|
not beginning with ``/''.
|
|
|
|
In order for a directory to become the current directory, a process must
|
|
have execute (search) access to the directory.
|
|
|
|
|
|
</PRE>
|
|
<H2>RETURN VALUE</H2><PRE>
|
|
Upon successful completion, a value of 0 is returned. Otherwise, a value
|
|
of -1 is returned and <STRONG>errno</STRONG> is set to indicate the error.
|
|
|
|
|
|
</PRE>
|
|
<H2>ERRORS</H2><PRE>
|
|
<STRONG>Chdir</STRONG> will fail and the current working directory will be unchanged if
|
|
one or more of the following are true:
|
|
|
|
[ENOTDIR] A component of the path prefix is not a directory.
|
|
|
|
[ENAMETOOLONG] The path name exceeds PATH_MAX characters.
|
|
|
|
[ENOENT] The named directory does not exist.
|
|
|
|
[ELOOP] Too many symbolic links were encountered in translating
|
|
the pathname. (Minix-vmd)
|
|
|
|
[EACCES] Search permission is denied for any component of the path
|
|
name.
|
|
|
|
[EFAULT] <EM>Path</EM> points outside the process's allocated address space.
|
|
|
|
[EIO] An I/O error occurred while reading from or writing to the
|
|
file system.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man2/chroot.2.html">chroot(2)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|