(Symbolic Links): Adjust description of realpath to new implementation.

This commit is contained in:
Ulrich Drepper 2002-05-16 06:38:36 +00:00
parent f7501ae6f1
commit 9905e036de
1 changed files with 13 additions and 6 deletions

View File

@ -1223,13 +1223,20 @@ where the result is placed in.
@comment XPG @comment XPG
@deftypefun {char *} realpath (const char *restrict @var{name}, char *restrict @var{resolved}) @deftypefun {char *} realpath (const char *restrict @var{name}, char *restrict @var{resolved})
The @code{realpath} function behaves just like A call to @code{realpath} where the @var{resolved} parameter is
@code{canonicalize_file_name} but instead of allocating a buffer for the @code{NULL} behaves exactly like @code{canonicalize_file_name}. The
result it is placed in the buffer pointed to by @var{resolved}. function allocates a buffer for the file name and returns a pointer to
it. If @var{resolved} is not @code{NULL} it points to a buffer into
which the result is copied. It is the callers responsibility to
allocate a buffer which is large enough. On systems which define
@code{PATH_MAX} this means the buffer must be large enough for a
pathname of this size. For systems without limitations on the pathname
length the requirement cannot be met and programs should not call
@code{realpath} with anything but @code{NULL} for the second parameter.
One other difference is that the buffer @var{resolved} will contain the One other difference is that the buffer @var{resolved} (if nonzero) will
part of the path component which does not exist or is not readable if contain the part of the path component which does not exist or is not
the function returns @code{NULL} and @code{errno} is set to readable if the function returns @code{NULL} and @code{errno} is set to
@code{EACCES} or @code{ENOENT}. @code{EACCES} or @code{ENOENT}.
This function is declared in @file{stdlib.h}. This function is declared in @file{stdlib.h}.