Subject: Re: [PATCH] do not typedef socklen_t on Android

From: Pablo Neira Ayuso <[email-masked]>
Date: Wed, 29 Apr 2020 00:21:57 +0200

On Mon, Apr 27, 2020 at 05:26:44PM -0700, Maciej Żenczykowski wrote:
> I don't know all that much about it.  Mostly it just seems to work.
> 
> I'm quoting from: https://en.wikipedia.org/wiki/Bionic_(software) ;-)
> 
> Bionic is basically a BSD licensed C library for use with Linux.
> This differs from other BSD C libraries which require a BSD kernel,
> and from the GNU C Library (glibc) which uses the GNU Lesser General
> Public License.
> 
> For the most part it's supposed to be drop-in compatible I think,
> and the kernel headers (uapi) come from some recent version of Linux.
> 
> The license and smaller size are AFAIK the main benefits.
> 
> ---
> 
> Got me curious and:
> 
> I'm not actually sure what defines __ANDROID__, maybe __BIONIC__ would
> be a better guard?
> 
> That seems to be defined in bionic/libc/include/sys/cdefs.h
> 
> https://android.googlesource.com/platform/bionic/+/master/libc/include/sys/cdefs.h#43
> 
> And the docs here:
> 
> https://android.googlesource.com/platform/bionic/+/master/docs/defines.md
> 
> do seem to suggest that __BIONIC__ is more equivalent to __GLIBC__

https://sourceforge.net/p/predef/wiki/Libraries/

This one also refers to the existing C library definitions which makes
more sense to me too.