home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / misc / 72 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.9 KB  |  51 lines

  1. Newsgroups: comp.sys.sgi.misc
  2. Path: sparky!uunet!psinntp!cadkey!steveg
  3. From: steveg@cadkey.com (Steve Gallichio)
  4. Subject: Re: Gethostbyname Error
  5. Message-ID: <1992Dec22.155450.12429@cadkey.com>
  6. Organization: cadkey
  7. References: <1992Dec21.033141.15406@news2.cis.umn.edu> <ts526sg@zuni.esd.sgi.com> <1992Dec21.181140.21504@news2.cis.umn.edu>
  8. Date: Tue, 22 Dec 1992 15:54:50 GMT
  9. Lines: 40
  10.  
  11. Mark Stephan Coyle:
  12. > I am programming on a 4D 310 VGX and am getting a segmentation fault
  13. > whenvever I use the system call "gethostbyname".  The code works on
  14. > other machines, bu not on this sgi.  Any clues?
  15.  
  16. Dave (the Psychic Debugger) Olson:
  17. > Are you perhaps passing a bogus pointer?
  18.  
  19. Andrew Cherenson:
  20. > It's important to make sure hp isn't NULL before using it.
  21.  
  22. RTFM gethostbyname:
  23. > There are two versions of the routines documented in this  manual  entry:
  24. > the  standard C library version and the NIS version in /usr/lib/libsun.a.
  25. > The programmatic interface of both  versions  is  identical,  except  for
  26. > gethostent.   The  standard  version  is the default; if you want the NIS
  27. > version, follow the instructions for  (3Y)  routines  in  intro(3).   The
  28. > differences are described below.
  29.  
  30.     [...make sure to include -lsun BEFORE -lc_s if you are including
  31.     the c library on the link line... (ed)]
  32.  
  33. > LIBC VERSION
  34. >    The default resolution order is: query the BIND name server first, if is
  35. >    not configured, then search /etc/hosts.
  36. > NIS VERSION
  37. >    If NIS is enabled, gethostbyname and gethostbyaddr access the NIS
  38. >    databases.  Otherwise, they use the same resolution order as the libc
  39. >    versions.
  40.  
  41. My guess is that you want to pick up the NIS entry for dexter.psych.umn.edu
  42. but are not getting it without the linking of -lsun.
  43.  
  44. Hope this helps...now back to my tarot cards.
  45. -- 
  46. Steve Gallichio       |"Have you ever heard of Plato? Aristotle? Socrates?
  47. Cadkey, Inc.          |             ...Morons!"
  48. steveg@cadkey.com     |
  49.