From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2277 invoked from network); 31 Mar 2023 00:36:04 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 Mar 2023 00:36:04 -0000 Received: (qmail 28460 invoked by uid 550); 31 Mar 2023 00:36:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28428 invoked from network); 31 Mar 2023 00:35:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680222948; bh=f/qjEDVjPaQrDB/aWrHm+cFTIqqZvOg3AP8wf0HUWng=; h=Subject:From:To:Date:From; b=NmU4hhzy2aDtJgX4AHlgvo06hX7ClJiH5Hs+7PacpP/7Ik3T+utvu2UPIxdFO1Yza xotbtn9pJ7GP+wvZkRY7NhLqzGAQZFKuH1kxKDaJJqqeGoAnAe//BqxPvUUXwTPmtA wJWpXgYw181+k5FSCD3KCLEoZxi1OQ5quwIzH7w1eLLs40SzZqjL5qnn71yzFmLyS4 q+KMnoKgQYFMxv1wyp9G5wm5SyQAOr6sPN2wmzLso/Xod//pOBGG4rUdY2VYkK/UUE /8BmVCNvdqvY/YSAdSUqQoCePkDhX8keEeqpPVHyUFo80S5LrNxhBfVyctS+lwaBHb e+R6rPcA/banA== Message-ID: <0e96cffef26b0a5b689e6d316211829f6ed1a1cf.camel@posteo.net> From: John Scott To: musl@lists.openwall.com Date: Fri, 31 Mar 2023 00:35:36 +0000 Jabber-ID: pert@member.fsf.org Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-hYGOiBQ0HN9lNZhpvFJz" MIME-Version: 1.0 Subject: [musl] [PATCH] Expose the fopencookie() data types more generally --=-hYGOiBQ0HN9lNZhpvFJz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, We're allowed to expose these data types in POSIX-conforming applications s= ince they're implementation-reserved, and I think it's a good idea. My use = case is that I want to check for fopencookie() via dlsym() without defining= _GNU_SOURCE, and having the definition of cookie_io_functions_t would be h= elpful for its usage. You may pull the signed commit from https://git.sr.ht/~jscott/musl-libc or = use the following patch =46rom f5f6db0d02db40dde067a3ad0a7fbd74f6019dd4 Mon Sep 17 00:00:00 2001 From: John Scott Date: Thu, 30 Mar 2023 20:26:13 -0400 Subject: [PATCH] Expose the fopencookie() data types more generally These data types end in _t and so can be exposed even when strict POSIX con= formance is sought. This might be useful for an application that doesn't wa= nt other side effects of defining _GNU_SOURCE, but which still wants to use= fopencookie(). --- include/stdio.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/stdio.h b/include/stdio.h index cb858618..a5206316 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -189,7 +189,11 @@ int vasprintf(char **, const char *, __isoc_va_list); #ifdef _GNU_SOURCE char *fgets_unlocked(char *, int, FILE *); int fputs_unlocked(const char *, FILE *); +#endif =20 +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); typedef int (cookie_seek_function_t)(void *, off_t *, int); @@ -201,7 +205,9 @@ typedef struct _IO_cookie_io_functions_t { cookie_seek_function_t *seek; cookie_close_function_t *close; } cookie_io_functions_t; +#endif =20 +#ifdef _GNU_SOURCE FILE *fopencookie(void *, const char *, cookie_io_functions_t); #endif =20 --=20 2.35.1 --=-hYGOiBQ0HN9lNZhpvFJz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iIgEABYIADAWIQSiPzylvTnZ6xisfzWz9N0oYfTNugUCZCYq2RIcanNjb3R0QHBv c3Rlby5uZXQACgkQs/TdKGH0zbremgD9ERCOxW3r8F8mxX37t+1KhISHfYo3In/D h/IUb6mtu+oBAOCp3wPkfumuCg/iT56eKi/4kzltRVFKpt6MfPXUm94L =WjIM -----END PGP SIGNATURE----- --=-hYGOiBQ0HN9lNZhpvFJz--