unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

REALPATH(3)                Library Functions Manual                REALPATH(3)



NAME
       realpath - return the canonicalized absolute pathname

SYNOPSIS
       #include <&lt;sys/param.h>&gt;

       char *realpath(path, resolved_path)
       char *path;
       char resolved_path[MAXPATHLEN];

DESCRIPTION
       realpath() expands all symbolic links and resolves references to '/./',
       '/../' and extra '/' characters in the null terminated string named  by
       path and stores the canonicalized absolute pathname in the buffer named
       by resolved_path.  The resulting path will have no symbolic links  com-
       ponents, nor any '/./' or '/../' components.

RETURN VALUES
       realpath() returns a pointer to the resolved_path on success.  On fail-
       ure, it returns NULL, sets errno to indicate the error, and  places  in
       resolved_path  the  absolute pathname of the path component which could
       not be resolved.

ERRORS
       EACCES              Search permission is denied for a component of  the
                           path prefix of path.

       EFAULT              resolved_path  extends  outside the process's allo-
                           cated address space.

       ELOOP               Too many symbolic links were encountered in  trans-
                           lating path.

       EINVAL              path or resolved_path was NULL.

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

       ENAMETOOLONG        The length of the path argument exceeds {PATH_MAX}.

                           A pathname component is longer than {NAME_MAX} (see
                           sysconf(2V))  while  {_POSIX_NO_TRUNC} is in effect
                           (see pathconf(2V)).

       ENOENT              The named file does not exist.

SEE ALSO
       readlink(2), getwd(3)

WARNINGS
       It indirectly invokes the readlink(2) system call and getwd(3)  library
       call  (for  relative path names), and hence inherits the possibility of
       hanging due to inaccessible file system resources.



                                21 January 1990                    REALPATH(3)