Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, palves@redhat.com
Subject: Re: [RFA/gdbserver] Provide dummy readlink on systems where routine is not available.
Date: Fri, 03 Feb 2012 13:26:00 -0000	[thread overview]
Message-ID: <20120203132529.GK31383@adacore.com> (raw)
In-Reply-To: <83r4ycdptz.fsf@gnu.org>

> 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


  reply	other threads:[~2012-02-03 13:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  3:20 fix build error on MinGW (HAVE_READLINK) undefined asmwarrior
2012-01-27  9:41 ` Eli Zaretskii
2012-01-27 10:28   ` Pedro Alves
2012-01-27 12:22     ` Eli Zaretskii
2012-01-27 12:36       ` Pedro Alves
2012-01-27 12:47         ` Eli Zaretskii
2012-02-03 11:47     ` [RFA/gdbserver] Provide dummy readlink on systems where routine is not available Joel Brobecker
2012-02-03 11:56       ` Joel Brobecker
2012-02-03 12:31         ` Joel Brobecker
2012-02-03 13:11           ` Eli Zaretskii
2012-02-03 13:26             ` Joel Brobecker [this message]
2012-02-09 16:32     ` [RFA/commit] gdbserver: return ENOSYS if readlink not supported Joel Brobecker
2012-02-09 16:41       ` Pedro Alves
2012-02-09 17:32         ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120203132529.GK31383@adacore.com \
    --to=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox