[Bug libc/2417] New: getcwd() uses ENAMETOOLONG instead of ERANGE
A call to getcwd() with a buffer smaller than the actual path returns an error
ENAMETOOLONG on all architectures but ia64, whereas POSIX and the *GNU libc
manual* say ERANGE. Actually this is the value returned by the kernel.
IMHO the kernel has to be fixed, but the GNU libc should also correct the
number. That's the purpose of the attached patch.
Summary: getcwd() uses ENAMETOOLONG instead of ERANGE
AssignedTo: drepper at redhat dot com
ReportedBy: aurelien at aurel32 dot net
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
[Bug libc/2417] getcwd() uses ENAMETOOLONG instead of ERANGE
In reply to this post by fweimer at redhat dot com
------- Additional Comments From decimal at us dot ibm dot com 2006-03-10 17:12 -------
When you say "on all architectures but ia64" do you mean this is true for the
generic kernel or is this Debian specific? On OpenSUSE x86 10.0 I get ERANGE.
I do not see why glibc should put in a patch to work around a bug in the kernel.
This bug should be fixed in the kernel only. If glibc put in a workaround for
every simple kernel bug which code be fixed the code would quickly become