public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: libc-alpha@sourceware.org
Subject: Re: posix/glob.c: update from gnulib
Date: Wed, 30 Mar 2022 19:54:23 -0400	[thread overview]
Message-ID: <xn1qyjvvww.fsf@greed.delorie.com> (raw)
In-Reply-To: <038e38d7-59f3-527b-b6ae-f9b7d8ccdb06@cs.ucla.edu>

Paul Eggert <eggert@cs.ucla.edu> writes:
>> Used config.h instead of libc-config.h
>
> I don't see why this change is needed. This code is inside "#ifndef 
> _LIBC" so this change should have no effect for glibc. And the change is 
> harmful for Gnulib, since for this file Gnulib relies on including 
> libc-config.h instead of plain config.h.

I was just leaving that line as it was in glibc, but as you note, it
shouldn't make a difference.  glibc does have a config.h though, and no
libc-config.h, which is what made me think this was significant.

>> The #ifdef around #define dirfd() was changed to #undef due to
>> conflicts between glibc's internal and external definitions of
>> dirfd().  This has been reported to gnulib.
>
> I updated Gnulib to reflect this change; see first attached patch. That 
> being said, I don't fully understand it. Wouldn't it be more efficient 
> for glibc glob to use glibc's internal dirfd by whatever name you prefer?

Perhaps, but doing so involved more than just using a macro, because a
lot of what the internal macro does depends on having insight into the
internals of other modules (like typedef names, for example), which
involves other includes (for those typedefs) and such.  It was far
easier to just leave it alone than to go down that (perhaps shallow ;)
rabbit hole.  I.e. it was the minimum fix.

Since it's just a dereference I don't think it will affect performance.

> Anyway, the only difference between what you proposed for glibc and 
> current Gnulib glob is the second attached patch; could you please merge 
> that into your proposal? That way, the two glob.c files can be 
> identical, which is a good thing.

Done.


  parent reply	other threads:[~2022-03-30 23:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 21:55 DJ Delorie
2022-03-30 23:40 ` Paul Eggert
2022-03-30 23:45   ` Paul Eggert
2022-03-30 23:54   ` DJ Delorie [this message]
2022-03-31 10:56 ` Adhemerval Zanella
2022-03-31 17:38   ` DJ Delorie
2022-03-31 17:44     ` Adhemerval Zanella
2022-03-31 19:29       ` DJ Delorie
2022-03-31 19:38         ` Adhemerval Zanella
2022-03-31 20:00       ` [v2] " DJ Delorie
2022-04-01  1:55         ` Paul Eggert
2022-04-04 21:25           ` Carlos O'Donell
2022-04-14 23:40             ` [v3] " DJ Delorie
2022-04-27 21:16               ` Carlos O'Donell
2022-04-27 21:21                 ` DJ Delorie

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=xn1qyjvvww.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).