Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250820121414.GD1827@brightrain.aerifal.cx>
Date: Wed, 20 Aug 2025 08:14:14 -0400
From: Rich Felker <dalias@...c.org>
To: Khem Raj <raj.khem@...il.com>
Cc: musl@...ts.openwall.com, nsz@...t70.net
Subject: Re: [PATCH] api/unistd: guard optional/obsolete *_PC/*_SC
 constants for musl

On Tue, Aug 19, 2025 at 11:34:22PM -0700, Khem Raj wrote:
> musl does not define some POSIX option macros:
> - _SC_XOPEN_UUCP is obsolete and absent on musl
> - _PC_TIMESTAMP_RESOLUTION is optional and may be undefined

Neither is optional. The test is correctly diagnosing that we don't
have them.

> Build currently fails when these are referenced unconditionally.
> Wrap the checks in #ifdef so the test compiles on musl without
> claiming support for unavailable names.
> 
> Signed-off-by: Khem Raj <raj.khem@...il.com>
> ---
>  src/api/unistd.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/api/unistd.c b/src/api/unistd.c
> index 522ccdc..0de547b 100644
> --- a/src/api/unistd.c
> +++ b/src/api/unistd.c
> @@ -114,7 +114,9 @@ C(_PC_REC_MIN_XFER_SIZE)
>  C(_PC_REC_XFER_ALIGN)
>  C(_PC_SYMLINK_MAX)
>  C(_PC_SYNC_IO)
> +#ifdef _PC_TIMESTAMP_RESOLUTION
>  C(_PC_TIMESTAMP_RESOLUTION)
> +#endif
>  C(_PC_VDISABLE)
>  C(_SC_2_C_BIND)
>  C(_SC_2_C_DEV)
> @@ -235,7 +237,9 @@ C(_SC_XOPEN_REALTIME_THREADS)
>  C(_SC_XOPEN_SHM)
>  C(_SC_XOPEN_STREAMS)
>  C(_SC_XOPEN_UNIX)
> +#ifdef _SC_XOPEN_UUCP
>  C(_SC_XOPEN_UUCP)
> +#endif
>  C(_SC_XOPEN_VERSION)
>  C(STDERR_FILENO)
>  C(STDIN_FILENO)

This defeats the whole purpose of the test.

Rich

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.