Find the answer to your Linux question:
Results 1 to 4 of 4
recently,I am working at finding a function in the kernel land equivalent to the gethostbyname function. But I failed. I once browse many sites concerning the linux kernel looking for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    5

    who can tell me where i can get the source code of the gethostbyname function?


    recently,I am working at finding a function in the kernel land equivalent to the gethostbyname function. But I failed. I once browse many sites concerning the linux kernel looking for the function. At last i realized that in the linux kernel land there doesnt exist the DNS function that i am looking for.
    if anyone knows where can i get the source code of the function or how can realize the function in the kernel land,pls tell me and i will be appreciated greatly!!

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Well, the function is prototyped in netdb.h, which is included in glibc. You can dig around the glibc source tree and find the implementation. Or you can take the prototype and write the function yourself...it would be more fun that way.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Just Joined!
    Join Date
    Sep 2005
    Posts
    5
    Thank you for your help. I think I will implement the function by myself. It will be really more funny!!

  4. #4
    Just Joined!
    Join Date
    Nov 2006
    Posts
    1

    still not in ?

    Is the function still not available in the kernel land ? and did you write it for your use ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •