X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=doc%2Fposix-functions%2Fgetcwd.texi;h=ffb5086ffbc8b929dad119cf8bf1d9a9bb9b080d;hb=eadf1d03c19abe009c81484b3ebaa443b884a95d;hp=6a76caaf1af7bd8a246667b2e2b8e184382a7330;hpb=2b6c08c775ae4e80b52aa41058ea5939f778b44b;p=gnulib.git diff --git a/doc/posix-functions/getcwd.texi b/doc/posix-functions/getcwd.texi index 6a76caaf1..ffb5086ff 100644 --- a/doc/posix-functions/getcwd.texi +++ b/doc/posix-functions/getcwd.texi @@ -2,17 +2,30 @@ @section @code{getcwd} @findex getcwd -POSIX specification: @url{http://www.opengroup.org/susv3xsh/getcwd.html} +POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getcwd.html} -Gnulib module: getcwd +Gnulib module: getcwd or getcwd-lgpl -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{getcwd} or +@code{getcwd-lgpl}: @itemize @item -This function is missing on some older platforms. -@item On glibc platforms, @code{getcwd (NULL, n)} allocates memory for the result. -On other platforms, this call is not allowed. +On some other platforms, this call is not allowed. +@item +On some platforms, the prototype for @code{getcwd} uses @code{int} +instead of @code{size_t} for the size argument: +mingw. +@item +On some platforms, @code{getcwd (buf, 0)} fails with @code{ERANGE} +instead of the required @code{EINVAL}: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{getcwd}: +@itemize +@item +This function is missing on some older platforms. @item This function does not handle long file names (greater than @code{PATH_MAX}) correctly on some platforms. @@ -20,4 +33,11 @@ correctly on some platforms. Portability problems not fixed by Gnulib: @itemize +@item +When using @code{getcwd(NULL, nonzero)}, some platforms, such as glibc +or cygwin, allocate exactly @code{nonzero} bytes and fail with +@code{ERANGE} if it was not big enough, while other platforms, such as +FreeBSD or mingw, ignore the size argument and allocate whatever size +is necessary. If this call succeeds, an application cannot portably +access beyond the string length of the result. @end itemize