This is a question similar as warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking.
In runtime, getaddrinfo("localhost") will open /etc/resolv.conf, this is strange! I'v even found that gcc statically linked executable file will contain hardcoding string such as /etc/resolv.conf, is this terrible?
localhost:tmp macq$ strings node.armv5.static |grep /etc
// Test: ./node test/fixtures/echo.js < /etc/passwd
/etc/egd-pool
/etc/entropy
/etc/ssl/private
/etc/ssl
/etc/ssl/certs
/etc/ssl/cert.pem
/etc/hosts
/etc/resolv.conf
/etc/nsswitch.conf
/etc/host.conf
/etc/svc.conf
/etc/localtime
/etc/gai.conf
/etc/ld.so.cache
/etc/ld.so.nohwcap
/etc/suid-debug
/etc/mtab
I just want to know the source of this warning and the logic of getaddrinfo.
I think it is from libgcc, but i'v checked source of gcc 4.4, 4.5 totally, not found such error string pattern, event not found getaddrinfo implementation. I could not find source of ld(colloect2).
Where is the source of getaddrinfo in gcc? where is the source of libnss_files.so?
Edit: Thank you all guys. I'v changed the title now, Who can tell me the source code of implementation of things like getaddrinfo, they seems not in libc.