RFC 3493 specifies flag "AI_NUMERICSERV", analogous to AI_NUMERICHOST, for the ai_flags field of hints: "If the AI_NUMERICSERV flag is specified, then a non-null servname string supplied shall be a numeric port string. Otherwise, an [EAI_NONAME] error shall be returned. This flag shall prevent any type of name resolution service (for example, NIS+) from being invoked." netdb.h doesn't defined AI_NUMERICSERV and getaddrinfo() doesn't implement it.
*** This bug has been marked as a duplicate of 296 ***