MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


System Calls                                       resolvepath(2)



NAME
     resolvepath - resolve all symbolic links of a path name

SYNOPSIS
     #include 

     int resolvepath(const char *path, char *buf, sizet bufsiz);


DESCRIPTION
     The resolvepath() function fully resolves all symbolic links
     in  the  path  name  path into a resulting path name free of
     symbolic links and places the resulting  path  name  in  the
     buffer  buf  which  has size bufsiz. The resulting path name
     names the same file or directory as the original path  name.
     All  ``.''  components  are eliminated and every non-leading
     ``..'' component is eliminated together with  its  preceding
     directory  component.  If leading ``..'' components reach to
     the root directory, they  are  replaced  by  ``/''.  If  the
     number of bytes in the resulting path name is less than buf-
     siz, the contents of the remainder of buf are unspecified.

RETURN VALUES
     Upon successful completion, resolvepath() returns the  count
     of  bytes  placed  in the buffer. Otherwise, it returns  -1,
     leaves the buffer unchanged, and sets errno to indicate  the
     error.

ERORS
     The resolvepath() function will fail if:

     EACES          Search permission is denied for a  component
                     of  the  path  prefix  of path or for a path
                     prefix component resulting from the  resolu-
                     tion of a symbolic link.


     EFAULT          The path or buf argument points to an  ille-
                     gal address.


     EIO             An I/O error occurred while reading from the
                     file system.


     ENOENT          The path argument is an empty  string  or  a
                     component  of  path or a path name component
                     produced by resolving a symbolic  link  does
                     not name an existing file.






SunOS 5.11          Last change: 12 May 1997                    1






System Calls                                       resolvepath(2)



     ELOP           Too many symbolic links were encountered  in
                     resolving path.


     ENAMETOLONG    The length of path exceeds  PATHMAX,  or  a
                     path name component is longer than NAMEMAX.
                     Path name resolution of a symbolic link pro-
                     duced  an  intermediate  result whose length
                     exceeds PATHMAX or a component whose length
                     exceeds NAMEMAX.


     ENOTDIR         A component of the path prefix of path or of
                     a  path  prefix component resulting from the
                     resolution of  a  symbolic  link  is  not  a
                     directory.


USAGE
     No more than PATHMAX bytes will be placed  in  the  buffer.
     Applications should not assume that the returned contents of
     the buffer are null-terminated.

SEE ALSO
     readlink(2), realpath(3C)






























SunOS 5.11          Last change: 12 May 1997                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™