Sun Sep 3 17:04:00 GMT 2000
On Sun, Sep 03, 2000 at 09:33:28PM +0400, Egor Duda wrote:
> linux man says about readlink():
>readlink places the contents of the symbolic link path in the buffer
>buf, which has size bufsiz. readlink does not append a NUL character
>to buf. It will truncate the contents (to a length of bufsiz
>characters), in case the buffer is too small to hold all of the
>susv2 is rather vague on this subject, but there's no "buffer too
>small" in its list of error conditions. i don't know what other
>standards say about readlink. this patch is to make cygwin readlink
>behaving like linux one.
This is from my linux man page:
>READLINK(2) Linux Programmer's Manual READLINK(2)
> readlink - read value of a symbolic link
> #include <unistd.h>
> int readlink(const char *path, char *buf, size_t bufsiz);
> readlink places the contents of the symbolic link path in
> the buffer buf, which has size bufsiz. readlink does not
> append a NUL character to buf. It will truncate the con-
> tents (to a length of bufsiz characters), in case the
> buffer is too small to hold all of the contents.
> The call returns the count of characters placed in the
> buffer if it succeeds, or a -1 if an error occurs, placing
> the error code in errno.
> ENOTDIR A component of the path prefix is not a directory.
> EINVAL bufsiz is not positive.
> A pathname, or a component of a pathname, was too
To me, this means that removing ENAMETOOLONG is the wrong way to go.
More information about the Cygwin-patches