5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getcwd.html}
7 Gnulib module: getcwd or getcwd-lgpl
9 Portability problems fixed by either Gnulib module @code{getcwd} or
13 On glibc platforms, @code{getcwd (NULL, n)} allocates memory for the result.
14 On some other platforms, this call is not allowed.
16 On some platforms, the prototype for @code{getcwd} uses @code{int}
17 instead of @code{size_t} for the size argument:
20 On some platforms, @code{getcwd (buf, 0)} fails with @code{ERANGE}
21 instead of the required @code{EINVAL}:
25 Portability problems fixed by Gnulib module @code{getcwd}:
28 This function is missing on some older platforms.
30 This function does not handle long file names (greater than @code{PATH_MAX})
31 correctly on some platforms.
34 Portability problems not fixed by Gnulib:
37 When using @code{getcwd(NULL, nonzero)}, some platforms, such as glibc
38 or cygwin, allocate exactly @code{nonzero} bytes and fail with
39 @code{ERANGE} if it was not big enough, while other platforms, such as
40 FreeBSD or mingw, ignore the size argument and allocate whatever size
41 is necessary. If this call succeeds, an application cannot portably
42 access beyond the string length of the result.