mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] canonicalize_file_name(3)
@ 2022-08-18 17:30 Alejandro Colomar
  2022-08-19 13:48 ` NRK
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Colomar @ 2022-08-18 17:30 UTC (permalink / raw)
  To: musl


[-- Attachment #1.1: Type: text/plain, Size: 671 bytes --]

Hi,

I've seen than many programs workaround the fact that musl lacks 
canonicalize_file_name(3) (which is a glibc extension).  Would you 
consider adding it to musl?  It relies on a glibc extension to 
realpath(3), although it could be implemented in terms of a standard 
realpath(3) (by looping), or even as a completely separate function.

We need it in a project, and will probably have to write our own version 
(unless we workaround it in a different way), since we can't rely on 
glibc.  Maybe you're interested in picking that code when we have it or 
write your own?

Thanks,

Alex


-- 
Alejandro Colomar
<http://www.alejandro-colomar.es/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] canonicalize_file_name(3)
  2022-08-18 17:30 [musl] canonicalize_file_name(3) Alejandro Colomar
@ 2022-08-19 13:48 ` NRK
  2022-08-19 17:10   ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: NRK @ 2022-08-19 13:48 UTC (permalink / raw)
  To: musl

On Thu, Aug 18, 2022 at 07:30:10PM +0200, Alejandro Colomar wrote:
> It relies on a glibc extension to realpath(3)

What extension are we talking about exactly?
Because `man canonicalize_file_name` states the following:

| The call canonicalize_file_name(path) is equivalent to the call:
|          realpath(path, NULL);

Calling realpath with NULL as the 2nd parameter is well defined since
POSIX-2008 [0], if that's what you were talking about.

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

- NRK

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] canonicalize_file_name(3)
  2022-08-19 13:48 ` NRK
@ 2022-08-19 17:10   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2022-08-19 17:10 UTC (permalink / raw)
  To: NRK; +Cc: musl

On Fri, Aug 19, 2022 at 07:48:33PM +0600, NRK wrote:
> On Thu, Aug 18, 2022 at 07:30:10PM +0200, Alejandro Colomar wrote:
> > It relies on a glibc extension to realpath(3)
> 
> What extension are we talking about exactly?
> Because `man canonicalize_file_name` states the following:
> 
> | The call canonicalize_file_name(path) is equivalent to the call:
> |          realpath(path, NULL);
> 
> Calling realpath with NULL as the 2nd parameter is well defined since
> POSIX-2008 [0], if that's what you were talking about.
> 
> [0]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

This. To further elaborate, we generally don't add nonstandard
functions when there is a fully portable (or even just "at least as
portable as the extension" i.e. "works everywhere the extension would
have worked") way to do exactly the same thing that takes no effort
for the affected software to fix and do right.

Rich

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-19 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 17:30 [musl] canonicalize_file_name(3) Alejandro Colomar
2022-08-19 13:48 ` NRK
2022-08-19 17:10   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).