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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16135 invoked from network); 30 Nov 2022 19:39:40 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2022 19:39:40 -0000 Received: (qmail 4029 invoked by uid 550); 30 Nov 2022 19:39:37 -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 3989 invoked from network); 30 Nov 2022 19:39:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bDmmAjy1ont41Q2J8MXypNjkMblnn+65as54JN+BbPQ=; b=AfzRPTQmTlP0BZE5kFK0ezdVXMh1s63ILvBwwxqblBGroNIV4L7cHKwpbV1g1Ee/EF NWWGuhTGklZrkG74HE1ZOTxWeW87pq/xt+P9FgLm85eWOg2X16EpzRJOq0RWyzO1E9id GjrZIKaoWsDNQDM+eD0zHiUzlYv1Suy6+aSfxO7dVeYeFmtQuy6k5LC+xh/P3H1g7SIR kxs0b22dEuZqhNBuS1mmuLbDwgidQ4WpNJfgrqRPTgGsOHjdMRkVJJwR9ES76F8GpQhT +0Ujk3sU5ZD/Q3iCSdFdupG6kPDLvqcXKHxBO1ZoUS7SuiDg8Y+ioO+WQZB3oKNgrxiK HnQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bDmmAjy1ont41Q2J8MXypNjkMblnn+65as54JN+BbPQ=; b=yv7Ur7d0B2GAuHnWvM5eOIqfZL9XvU7NPqGsdPzkR25ubwc4i6f4voyWB5AaeDe6np 1ZsB70js3Kg7jv2HFlUeIX0nFJoy4cfnB+GUOXq0cHXfpQaxSK1lgU87BiruGUOOrsWu FQ/1fLhM5NGCaUYs9zH41oBSHz3aQl+2rsv0gYrTrKb6oyEe7G2QaeKjLDPcPYwAu2ik uzXVJhQPQWXTLhb2C/f5NSV25lpo/zK+y4Vy0rw5gVcn/2S680QTTMakTyGs8mrkRO8f hezuIfjYTCltof6KAWZe3bodDn3IENR2/xOZS1yrfXZCv2pzVVnBi/HQPd7j+CQIlDJF uXpA== X-Gm-Message-State: ANoB5pnCB+eUn3KXCFSq0KWQ+4j51xiuHfyvK3+bqgaVTscE1Dc+KuVU ucTiJ+NVCzR9vxUk9S79Y/DNwoS59yTaeeouIFrzaqnrqggWog== X-Google-Smtp-Source: AA0mqf7GGfZZw461oJ6XMH0DOH9dX7/cHgqJ8Xs6kZafZJLF13w4KdCl2wtq1WozenhPec+LH9Y9QIlNA9XpSjh9TLk= X-Received: by 2002:a25:69d1:0:b0:6f2:883a:7d1a with SMTP id e200-20020a2569d1000000b006f2883a7d1amr30461362ybc.131.1669837164446; Wed, 30 Nov 2022 11:39:24 -0800 (PST) MIME-Version: 1.0 References: <20221110001318.10696-1-andrew@digital-domain.net> <853fa349-8e78-8ce8-f76f-79b4b9353913@gmail.com> <50485f46-99d0-69ee-0882-7e403334080c@gmail.com> <227F5B23-D17F-4675-B9CF-52BB5E4B7F34@shiz.me> In-Reply-To: <227F5B23-D17F-4675-B9CF-52BB5E4B7F34@shiz.me> From: enh Date: Wed, 30 Nov 2022 11:39:13 -0800 Message-ID: To: musl@lists.openwall.com Cc: alx.manpages@gmail.com Content-Type: multipart/alternative; boundary="00000000000005893a05eeb5435e" Subject: Re: [musl] [PATCH] memmem.3: Added list of known systems where this is available --00000000000005893a05eeb5435e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2022 at 7:33 AM Shiz wrote: > Hi there, > > > On 23 Nov Reiwa 4, at 14:16, Alejandro Colomar > wrote: > > > >>>> - Android is not a real Unix system, in that you can't even program > in C in > >>>> there, unless you're Google or have hacked your system. It's not > friendly > >>>> to us programmers, so we don't need to be friendly to it. I don't > want to > >>>> be cluttering the pages with information that is irrelevant to norma= l > users. > >>> > >>> I'm assuming bionic is being used in some of the Android free > >>> alternatives too, but then I'm not sure how usable for programming > those > >>> are either. And, well musl libc is not a real Unix system you can > program > >>> against either. :) > > > > The difference is only that bionic is not in use in useful systems > (AFAIK). :) > > > > So we have to do some decission here (and also about newlib, as reporte= d > by Brian). > > I=E2=80=99d like to chime in here and note that, valuations of usefulness= aside, > it *is* > possible to develop in C against an Android device, without needing any > hacks, > using the NDK[1]. As someone who has occasionally worked on big codebases > written > in C and C++ for Android devices, I would argue there=E2=80=99s value to = be had > there. :-) > plus i think bionic is the only libc that explicitly links to man7.org as the canonical source for documentation in its header files :-) funnily enough, this topic ("should the man pages talk about availability in libcs other than glibc?") came up before, and specifically for bionic mkerrisk seemed to think it was a reasonable idea ... but i (bionic maintainer) was less convinced. although i think that, yes, if someone's reading that part of the page, realistically they're either interested in macOS/iOS or Android (sorry, AIX or IRIX fans!), but specifically for those two systems the header files already contain machine-readable availability information via __attribute__((__available__)). fwiw, here's an example from bionic's illustrating both of those points: ``` /** * [copy_file_range(2)]( https://man7.org/linux/man-pages/man2/copy_file_range.2.html) copies * a range of data from one file descriptor to another. * * Returns the number of bytes copied on success, and returns -1 and sets `errno` * on failure. * * Available since API level 34. */ ssize_t copy_file_range(int __fd_in, off64_t* __off_in, int __fd_out, off64_t* __off_out, size_t __length, unsigned int __flags) __INTRODUCED_IN(34); ``` (if there's anything android-specific to note, we also mention that, but there are relatively few examples of those, and it's mostly just "SELinux means that only system processes can enable/disable swap" or whatever.) so it wasn't clear to me whether -- unless you automated it -- there was much value to duplicating that in the man pages? if you try to compile, you're going to get a clear compiler error saying "you need to be targeting OS version $whatever" anyway. i think the real question is "aye, but will they get that far?". for my part, i think the most value would come from cases that talk about "GNU extension" being a bit clearer whether that's "unique to glibc" (which a lot of people assume is what it means) or "initially in glibc, but a good enough idea that it's effectively ubiquitous now, even if it's not in POSIX because Solaris will never add it". and maybe the best way to clarify stuff like that is just to explicitly state "Available on macOS since 10.4. Available on Android since API level 23."? dunno. if anyone _does_ want to go that route, i'd be happy to help with the "raw data" side. (and certainly if anyone does start adding that, you'll force me to care about maintaining it :-) ) but my biggest problem right now is that man7.org isn't being updated, and i can't get hold of mkerrisk to try to offer him money to do it :-( (i do hope he's okay, wherever he is!) > > Cheers, > > > > Alex > > - Shiz > > [1]: https://developer.android.com/ndk --00000000000005893a05eeb5435e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Nov 23, 2022 at 7:33 AM Shiz = <hi@shiz.me> wrot= e:
Hi there,

> On 23 Nov Reiwa 4, at 14:16, Alejandro Colomar <alx.manpages@gmail.com> wro= te:
>
>>>> -=C2=A0 Android is not a real Unix system, in that you can= 't even program in C in
>>>> there, unless you're Google or have hacked your system= .=C2=A0 It's not friendly
>>>> to us programmers, so we don't need to be friendly to = it.=C2=A0 I don't want to
>>>> be cluttering the pages with information that is irrelevan= t to normal users.
>>>
>>> I'm assuming bionic is being used in some of the Android f= ree
>>> alternatives too, but then I'm not sure how usable for pro= gramming those
>>> are either. And, well musl libc is not a real Unix system you = can program
>>> against either. :)
>
> The difference is only that bionic is not in use in useful systems (AF= AIK).=C2=A0 :)
>
> So we have to do some decission here (and also about newlib, as report= ed by Brian).

I=E2=80=99d like to chime in here and note that, valuations of usefulness a= side, it *is*
possible to develop in C against an Android device, without needing any hac= ks,
using the NDK[1]. As someone who has occasionally worked on big codebases w= ritten
in C and C++ for Android devices, I would argue there=E2=80=99s value to be= had there. :-)

plus i think bionic is = the only libc that explicitly links to man7.org= as the canonical source for documentation in its header files :-)

funnily enough, this topic ("should the man pages= talk about availability in libcs other than glibc?") came up before, = and specifically for bionic mkerrisk seemed to think it was a reasonable id= ea ... but i (bionic maintainer) was less convinced. although i think that,= yes, if someone's reading that part of the page, realistically they= 9;re either interested in macOS/iOS or Android (sorry, AIX or IRIX fans!), = but specifically for those two systems the header files already contain mac= hine-readable availability information via __attribute__((__available__)).<= /div>

fwiw, here's an example from bionic's <= unistd.h> illustrating both of those points:

``= `
/**
=C2=A0* [copy_file_range(2)](https://man7.org/linux/man-pa= ges/man2/copy_file_range.2.html) copies
=C2=A0* a range of data from= one file descriptor to another.
=C2=A0*
=C2=A0* Returns the number o= f bytes copied on success, and returns -1 and sets `errno`
=C2=A0= * on failure.
=C2=A0*
=C2=A0* Available since API level 34.
=C2=A0= */
ssize_t copy_file_range(int __fd_in, off64_t* __off_in, int __fd_out,= off64_t* __off_out, size_t __length, unsigned int __flags) __INTRODUCED_IN= (34);
```

(if there's anything a= ndroid-specific to note, we also mention that, but there are relatively few= examples of those, and it's mostly just "SELinux means that only = system processes can enable/disable swap" or whatever.)

=
so it wasn't clear to me whether -- unless you automated it = -- there was much value to duplicating that in the man pages? if you try to= compile, you're going to get a clear compiler error saying "you n= eed to be targeting OS version $whatever" anyway.

=
i think the real question is "aye, but will they get that far?&qu= ot;. for my part, i think the most value would come from cases that talk ab= out "GNU extension" being a bit clearer whether that's "= unique to glibc" (which a lot of people assume is what it means) or &q= uot;initially in glibc, but a good enough idea that it's effectively ub= iquitous now, even if it's not in POSIX because Solaris will never add = it". and maybe the best way to clarify stuff like that is just to expl= icitly state "Available on macOS since 10.4. Available on Android sinc= e API level 23."? dunno.

if anyone _does_ wan= t to go that route, i'd be happy to help with the "raw data" = side. (and certainly if anyone does start adding that, you'll force me = to care about maintaining it :-) )

but my biggest = problem right now is that man7.org isn'= t being updated, and i can't get hold of mkerrisk to try to offer him m= oney to do it :-( (i do hope he's okay, wherever he is!)
=C2= =A0
> Cheers,
>
> Alex

- Shiz

[1]: https://developer.android.com/ndk
--00000000000005893a05eeb5435e--