Re: [RFA/gdbserver] Provide dummy readlink on systems where routine is not available.

Joel Brobecker
2012-02-03T13:26:07Z

> If memory serves, Pedro was against this when I suggested it.

Do you mean returning EINVAL, or having a dummy readlink?

> > + This function return -1 (error) and sets errno to ENOSYS to indicate
> > + that this function is not implemented. The caller should be prepared
> > + to recover from that. */
>
> But the function in fact returns EINVAL:

<swear-word>I'll fix that, but another day, when I seem to have
a functioning brain.

> I cannot resist re-iterating my original suggestion: test the file for
> existence, return ENOENT if it doesn't exist, and otherwise return
> EINVAL, meaning that the file is not a link.
>
> Or just use the readlink module from gnulib, which does exactly that.

The first suggestion is too much work that has already been done
by gnulib. The second is too much work for the time I have right
now because gnulib hasn't been formally introduced in gdbserver.
I tried doing just that many moons ago and failed miserably.
I think I have better chances today, but I am still not confident
at all. Part of the problem comes from the fact that gnulib more
or less assumes that the project using it uses automake, which
is not the case for neither GDB nor GDBserver.

This patch has the advantage of being simple and fixing a build failure
that has been lingering since Jan 20th. If peopler prefer, I can
implement the "#if noreadlink ... #else return ENOSYS" approach,
which is fewer changes, but less appealing (IMO).

--
Joel