On Mon, 26 Jul 2004 shinepeak@xxxxxxxxxxxx wrote:
Hello!
When I call gethostbyname() to get IP of localhost, it returned NULL, and perror() displayed "No such device". Why? My network was configured correctly.
Check your entry in /etc/hosts. gethostbyname uses /etc/hosts for the IPs of localhost; otherwise the function uses /etc/resolve.conf, if you are connected to any network.
Thank you! ______________________________________
===================================================================
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
** Quote for thought:
"To live a pure unselfish life, one must count nothing as one's own in the midst of abundance." -- Buddha
------------------------- Dinil Divakaran M S DON Lab (x8353, x8953) IIT Madras -------------------------
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/