home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11594 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.4 KB  |  53 lines

  1. Path: sparky!uunet!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!noc.msc.net!uc.msc.edu!shamash!runyon.cim.cdc.com!pbd
  2. From: pbd@runyon.cim.cdc.com (Paul Dokas)
  3. Newsgroups: comp.sys.sgi
  4. Subject: What's wrong with ldopen()???
  5. Message-ID: <45863@shamash.cdc.com>
  6. Date: 29 Jul 92 18:05:51 GMT
  7. Sender: usenet@shamash.cdc.com
  8. Reply-To: pbd@runyon.cim.cdc.com (Paul Dokas)
  9. Organization: ICEM Systems, Inc
  10. Lines: 41
  11.  
  12. We just upgraded to 4.0.5 and it broke our dynamic loader :-(
  13.  
  14. I've traced the problem down to ldopen().  Well actually with the
  15. structure that ldopen() returns.  The code fragment that is
  16. suspicious is:
  17.  
  18.    #include <ldfcn.h>
  19.  
  20.    void load(char *fname)
  21.    {
  22.      LDFILE *ld;
  23.      int     fd;
  24.  
  25.      ld = ldopen(fname, (LDFILE *) 0);
  26.      fd = fileno(IOPTR(ld));
  27.  
  28.      printf("fd = %d\n", fd)
  29.  
  30.      ldclose(ld);
  31.    }
  32.  
  33. It always prints:
  34.  
  35.      fd = -1
  36.  
  37. :-(
  38.  
  39. This worked on 4.0.1, but not under 4.0.5.
  40.  
  41. BTW, I've omitted all of the calls to other ld* functions (ldread, etc)
  42. that work.  It seems that the LDFILE structure is just not getting
  43. filled in correctly.
  44.  
  45. Any help solving this problem is greatly appreciated!
  46.  
  47. -- 
  48. #include <std.disclaimer>
  49. #define FULL_NAME               "Paul Dokas"
  50. #define EMAIL_PRIMARY           "pbd@runyon.cim.cdc.com"
  51. #define EMAIL_SECONDARY         "pbd@power1.cim.cdc.com"
  52. /*** Overpopulation is the leading cause of most environmental problems ***/
  53.