public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org
Cc: schwab@linux-m68k.org
Subject: Re: [PATCH] Handle DT_UNKNOWN in gconv-modules.d
Date: Wed, 9 Jun 2021 23:38:16 +0530	[thread overview]
Message-ID: <637d9c58-610a-e68f-b743-85c99e18be1d@sourceware.org> (raw)
In-Reply-To: <beb5f7d6-e7a7-32e3-6a46-ce5ba59e2bba@linaro.org>

On 6/9/21 10:51 PM, Adhemerval Zanella wrote:
> 
> 
> On 09/06/2021 01:38, Siddhesh Poyarekar via Libc-alpha wrote:
>> On filesystems that do not support dt_type, a regular file shows up as
>> DT_UNKNOWN.  Fall back to using lstat64 to read file properties in
>> such cases.
> 
> The patch looks ok, but two things raised checking on this code: 1.
> the code is essentially the same on both places and 2. the use of
> alloca() even when it is assured that is bounded and 2.
> 
> The former would be nice if could consolidate it (even by adding
> a file where both iconvconfig and iconv could include or even
> by a GLIBC_PRIVATE symbol), but it is not a deal breaker.

I tried to do this but the code came out clumsier because the result 
(call to handle_file vs read_conf_file) have different semantics.

> But I think we should move away from alloca, even when we know it
> is bounded (sorry if I didn't catch on the previous patch).  For
> this specific usage we can use asprintf to create the path or use
> a static PATH_MAX buffer.

I agree, a static PATH_MAX makes sense, I'll do that.

Thanks,
Siddhesh

  reply	other threads:[~2021-06-09 18:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  4:38 Siddhesh Poyarekar
2021-06-09 17:21 ` Adhemerval Zanella
2021-06-09 18:08   ` Siddhesh Poyarekar [this message]
2021-06-09 18:27     ` Florian Weimer
2021-06-09 18:28       ` Siddhesh Poyarekar

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=637d9c58-610a-e68f-b743-85c99e18be1d@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.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).