Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 31 Jan 2017 14:37:41 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Re: [alpine-devel] Non-standard C library

On Tue, Jan 31, 2017 at 02:23:10PM -0500, Rich Felker wrote:
> On Tue, Jan 31, 2017 at 01:08:07PM -0600, A. Wilcox wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> > 
> > On 31/01/17 12:50, William Pitcock wrote:
> > > On Tue, Jan 31, 2017 at 12:22 PM, Harald Arnesen 
> > > <harald@...gtun.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.
> > 
> > 
> > POSIX.1-2008 clearly says IPPORT_RESERVED shall be defined in <netdb.h>:
> > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html
> > 
> > .....
> > 
> > 
> > > I checked on both a Debian and FreeBSD machine and indeed, they 
> > > both have it in netinet/in.h.
> > 
> > .....
> > 
> > however, POSIX.1-2008 also clearly says <netdb.h> "may also make visible
> > all symbols from <netinet/in.h>".
> > 
> > 
> > > What shall we do?
> > 
> > 
> > Theoretically, the code they are compiling is wrong; POSIX only
> > guarantees the definition in <netdb.h>.  However, there is a bit of
> > leeway in the standard since <netdb.h> may include all symbols from
> > <netinet/in.h>; if it's defined there, <netdb.h> can pull that header
> > in providing the definition.
> > 
> > I would say that the best thing to do in the interests of
> > compatibility would be to put the definition in <netinet/in.h> *and*
> > fix whatever broken project that is (Snobol?) to include <netdb.h>.
> > This is what FreeBSD and glibc both do; define it in <netinet/in.h>
> > and include that header in <netdb.h>.
> 
> The name IPPORT_RESERVED is not reserved in the namespace for
> netinet/in.h, so it can't be added there unless it's conditional on
> nonstandard feature profile. That might be justifiable if lots of
> applications had the wrong expectation here, but being that this is
> the first time we've heard of the issue, it seems there are just a few
> (or only one) applications which are doing this wrong, and they should
> just be fixed.

I seem to have overlooked it in the second table of reserved names:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02

so it does seem like we could reasonably move it to netinet/in.h.

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.