I have just checked the man pages and apparently getaddrinfo() doesn't mind hints.ai_family being set to AF_UNSPEC.In that case it will return both available IPv4 and IPv6 addresses...
Also when I enter my own computer's name, it returns 4 IP addresses, 3 being IPv6 and 1 being IPv4...

Well, that's weird, so I will do a bit more research on that and write here if I find anything out

Thanks for your help