Bruno Haible <[EMAIL PROTECTED]> 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