bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-6.0 on BeOS (6)


From: Simon Josefsson
Subject: Re: coreutils-6.0 on BeOS (6)
Date: Wed, 23 Aug 2006 10:33:14 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> The reason is that BeOS does not have PF_INET, only AF_INET, but usually they
> have the same values. Also it doesn't have PF_UNSPEC.

Does it AF_UNSPEC?  Did you grep the entire /usr/include tree to find
PF_INET or PF_UNSPEC?  Maybe they are in some non-standard header.

> This is quite a hacky fix, but I don't know what value could be used for
> PF_UNSPEC if we were to make a <sys/socket.h> override.

Perhaps 0.

> + /* BeOS has AF_INET, but not PF_INET.  */
> + #ifndef PF_INET
> + # define PF_INET AF_INET
> + #endif

Seems reasonable.

> + #ifdef PF_UNSPEC /* BeOS lacks PF_UNSPEC. */
>        if (family == PF_UNSPEC)
>          return true;
> + #endif

I'm not sure this will do the right thing.  Usually getaddrinfo is
called with hints structure that is zeroed out, and only the relevant
flags asserted.  If family isn't asserted, it usually means "take any
family".

With the above change, I don't think getaddrinfo will work at all on
BeOS.  It will just return EAI_FAMILY.  Most callers (rightly) doesn't
specify a family.

The best would be if AF_UNSPEC existed, then we can map PF_UNSPEC to
it.  If not, I think we'd might as well bind it to 0 directly.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]