![]() |
|
Message-Id: <7B56A637-B8BA-4CD1-A04D-7489383B419C@Wilcox-Tech.com> Date: Thu, 10 Jul 2025 20:18:02 -0500 From: "A. Wilcox" <AWilcox@...cox-Tech.com> To: musl@...ts.openwall.com Subject: Re: getpass() feature test macro On Jul 10, 2025, at 19:58, Haelwenn (lanodan) Monnier <contact@...ktivis.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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.