readlink.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <html>
  2. <head>
  3. <title>readlink</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>readlink</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. readlink - fetch symbolic link contents
  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. readlink(const char *<em>path</em>, char *<em>buf</em>, size_t <em>len</em>);
  16. <h3>Description</h3>
  17. readlink retrieves the contents of the symbolic link named by
  18. <em>path</em> and places them in the buffer <em>buf</em>. At most
  19. <em>len</em> bytes are written.
  20. <p>
  21. readlink does not include a null terminator in <em>buf</em>.
  22. <h3>Return Values</h3>
  23. readlink returns the number of characters transferred. If an error
  24. occurs, -1 is returned, and <A HREF=errno.html>errno</A> is set
  25. according to the error encountered.
  26. <h3>Errors</h3>
  27. The following error codes should be returned under the conditions
  28. given. Other error codes may be returned for other errors not
  29. mentioned here.
  30. <blockquote><table width=90%>
  31. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  32. <tr><td>ENODEV</td> <td>The device prefix of <em>filename</em> did
  33. not exist.</td></tr>
  34. <tr><td>ENOTDIR</td> <td>A non-final component of <em>path</em>
  35. was not a directory.</td></tr>
  36. <tr><td>ENOENT</td> <td>The named file does not exist.</td></tr>
  37. <tr><td>EINVAL</td> <td>The named file is not a symlink.</td></tr>
  38. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  39. <tr><td>EFAULT</td> <td><em>buf</em> or <em>path</em> points to an
  40. invalid address.</td></tr>
  41. </table></blockquote>
  42. </body>
  43. </html>