chdir.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <html>
  2. <head>
  3. <title>chdir</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>chdir</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. chdir - change current directory
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;unistd.h&gt;<br>
  13. <br>
  14. int<br>
  15. chdir(const char *<em>pathname</em>);
  16. <h3>Description</h3>
  17. The current directory of the current process is set to the directory
  18. named by <em>pathname</em>.
  19. <p>
  20. <h3>Return Values</h3>
  21. On success, chdir returns 0. On error, -1 is returned, and
  22. <A HREF=errno.html>errno</A> is set according to the error
  23. encountered.
  24. <h3>Errors</h3>
  25. The following error codes should be returned under the conditions
  26. given. Other error codes may be returned for other errors not
  27. mentioned here.
  28. <blockquote><table width=90%>
  29. <tr><td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  30. <tr><td>ENODEV</td> <td>The device prefix of <em>pathname</em> did
  31. not exist.</td></tr>
  32. <tr><td>ENOTDIR</td> <td>A non-final component of <em>pathname</em>
  33. was not a directory.</td></tr>
  34. <tr><td>ENOTDIR</td> <td><em>pathname</em> did not refer to a
  35. directory.</td>
  36. <tr><td>ENOENT</td> <td><em>pathname</em> did not exist.</td></tr>
  37. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  38. <tr><td>EFAULT</td> <td><em>pathname</em> was an invalid pointer.</td></tr>
  39. </table></blockquote>
  40. </body>
  41. </html>