mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
To: musl@lists.openwall.com
Subject: Re: [musl] getpass() feature test macro
Date: Thu, 10 Jul 2025 20:18:02 -0500	[thread overview]
Message-ID: <7B56A637-B8BA-4CD1-A04D-7489383B419C@Wilcox-Tech.com> (raw)
In-Reply-To: <aHBhnP91d6AWmGKl@cloudsdale.the-delta.net.eu.org>

On Jul 10, 2025, at 19:58, Haelwenn (lanodan) Monnier <contact@hacktivis.me> wrote:
>> 
>> getpass() was in SUSv2 but already marked legacy: https://pubs.opengroup.org/onlinepubs/007908799/xsh/getpass.html
>> 
>> SUSv2 uses _POSIX_C_SOURCE 199506L: https://pubs.opengroup.org/onlinepubs/007908799/xsh/compilation.html
>> 
>> And expectedly, SUSv3 removed it: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap01.html
>> 
>> Which uses _POSIX_C_SOURCE 200112L: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html
> 
> PS: Looking at the PDFs, it has EX shading (extension, seems like early form of XSI shading); so feature macro should be (_XOPEN_SOURCE < 600).
> But `_XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)` seems okay, just potentially misleading due to the !
> 
> Best Regards

Actually, not quite!  That shading is used in SUSv2 for any “feature group” - of which “LEGACY” is one.  A conforming implementation that implements all legacy interfaces is meant to define _XOPEN_LEGACY to something other than -1, and a conforming implementation that does *not* implement legacy interfaces is meant to define _XOPEN_LEGACY to -1.  It does not, afaik, affect which feature macros should be used to request it

They seem to have missed a few “de-shadings”, too, because i.e. getpgid is still shaded as XSI even though it was moved to Base for Issue 5.

As a historical note, SUSv1 (Issue 4, Version 2), which is the oldest standard I still have, shades XSI interfaces as “UX” and the “To Be Withdrawn” (what became LEGACY) interfaces as “EX”; it wasn’t until SUSv2 (Issue 5) when it seems all the shading was unified.  The explanation is found in the change history of <unistd.h> there - these legacy functions were added there but marked as “extensions” because they are “not necessary to implement the base specification”.

Best,
-Anna

      reply	other threads:[~2025-07-11  1:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 21:52 [musl] getpass() feature test macro Thomas Petazzoni
2025-07-09 22:20 ` Thorsten Glaser
2025-07-09 23:56   ` [musl] " Rich Felker
2025-07-10  7:55     ` Thomas Petazzoni
2025-07-10 15:54       ` Rich Felker
2025-07-10 15:56         ` Thomas Petazzoni
2025-07-10 16:01           ` Rich Felker
2025-07-10 16:13             ` Thomas Petazzoni
2025-07-10 16:40               ` Rich Felker
2025-07-11 19:16               ` Thorsten Glaser
2025-07-11  0:46     ` [musl] " Haelwenn (lanodan) Monnier
2025-07-11  0:58       ` Haelwenn (lanodan) Monnier
2025-07-11  1:18         ` A. Wilcox [this message]

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=7B56A637-B8BA-4CD1-A04D-7489383B419C@Wilcox-Tech.com \
    --to=awilcox@wilcox-tech.com \
    --cc=musl@lists.openwall.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.
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).