Mail archive
alpine-devel

Re: [alpine-devel] Non-standard C library

From: William Pitcock <nenolod_at_dereferenced.org>
Date: Tue, 31 Jan 2017 12:50:25 -0600

Hello,

On Tue, Jan 31, 2017 at 12:22 PM, Harald Arnesen <harald_at_skogtun.org> wrote:
> musl defines "IPPORT_RESERVED" in "netdb.h", while both GNU libc and BSD
> libc define it in "netinet/in.h". And I can't find an e-mail address for
> a musl developer without subscribing to their mailing list.
>
>
> This is from a conversation with Snobol maintainer Phil Budne:
>
>> > This one is from an old Asus EeePC 900, running AlpineLinux, which uses
>> > the musl libc instead of glibc. A compile error ('IPPORT_RESERVED'
>> > undeclared) in 'lib/auxil/bindresvport.c' was fixed by
>> > '#include <netdb.h>'
>
> Thanks!
>
> I'd report it as a bug in libc.... IPPORT_RESERVED is a property of
> on the wire protocol (or at least the local TCP stack), while
> <netdb.h> is the interface for hostname lookups.
>
> Linux and BSD agree the constant comes from netinet/in.h
>
> And charmingly, they refuse to define an ifdef so you can tell
> you're using their broken library (because they're never wrong):
>
> http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
>
> I've put this in after #include <errno.h>:
>
> #if !defined(IPPORT_RESERVED) && !defined(__GLIBC__)
> /*
> * could be using broken musl libc!
> * they refuse to identify themselves:
> * http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
> */
> #include <netdb.h>
> #endif

I checked on both a Debian and FreeBSD machine and indeed, they both
have it in netinet/in.h.

What shall we do?

William


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Tue Jan 31 2017 - 12:50:25 GMT