


REALPATH(3)            C LIBRARY FUNCTIONS            REALPATH(3)



NAME
     realpath - returns the canonicalized absolute pathname.

SYNOPSIS
     #include <sys/param.h>

     char *realpath(file_name, resolved_name)
     char *file_name;
     char resolved_name[MAXPATHLEN];

DESCRIPTION
     realpath() expands all symbolic links  and  resolves  refer-
     ences  to '/./', '/../' and extra '/' characters in the null
     terminated string named by _f_i_l_e__n_a_m_e and stores the  canoni-
     calized   absolute   pathname   in   the   buffer  named  by
     _r_e_s_o_l_v_e_d__n_a_m_e.  The resulting path  will  have  no  symbolic
     links components, nor any '/./' or '/../' components.

RETURN VALUE
     If  there  is  no  error,  it  returns  a  pointer  to   the
     _r_e_s_o_l_v_e_d__n_a_m_e.

     Otherwise  it  returns  a  NULL  pointer   and   places   in
     _r_e_s_o_l_v_e_d__n_a_m_e  the  absolute  pathname of the _f_i_l_e__n_a_m_e com-
     ponent which could not  be  resolved.  The  global  variable
     _e_r_r_n_o is set to indicate the error. If any of the parameters
     are NULL, _e_r_r_n_o will be set to EINVAL. realpath() indirectly
     invokes  the  readlink(2)  system  call and getwd(3) library
     call (for relative path names), and _e_r_r_n_o  will  be  set  by
     them.

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.
















Sun Release 4.0    Last change: 25 March 1989                   1



