home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / apollo / 3132 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.8 KB  |  51 lines

  1. Newsgroups: comp.sys.apollo
  2. Path: sparky!uunet!caen!afgun
  3. From: afgun@engin.umich.edu (Andrew F. Gunnesch)
  4. Subject: Re: Need asknode_$info help
  5. Message-ID: <sHV-=M#@engin.umich.edu>
  6. Date: Tue, 28 Jul 92 16:49:37 EDT
  7. Organization: CAEN, University of Michigan
  8. References: <RHV-VC#@engin.umich.edu>
  9. Sender: afgun@engin.umich.edu
  10. Followup-To: comp.sys.apollo
  11. Nntp-Posting-Host: beck.engin.umich.edu
  12. Lines: 37
  13.  
  14. In article <RHV-VC#@engin.umich.edu> I wrote:
  15. >#include <stdio.h>
  16. >#include "/us/ins/ubase.ins.c"
  17. >#include "/us/ins/asknode.ins.c"
  18. >
  19. >main()
  20. >{
  21. >    network_t    mynetwork;
  22. >    status_$t    status;
  23. >
  24. >
  25. >    asknode_$info(ask_network_number, (node_t)0, 0, &mynetwork, status);
  26. >                    /* Ask the node it's network number */
  27. >    if (status.all != status_$ok) 
  28. >        fprintf(stderr, "Get network request failed.\n");
  29. >    else
  30. >        printf("%lX\n", mynetwork);
  31. >}
  32. >
  33. >Here's a little bit of code.  From ubase.ins.c, network_t is typedef'ed to
  34. >an unsigned long.  The network number that I get back SHOULD be 29cf7, but
  35. >it varies, and starts with 760.  Eg, several different runs produced either
  36. >7600aca4 or 760de310.  What am I doing wrong here?
  37. >
  38.  
  39. Well, the code that I posted was taken in chunks out of my program.  I ran
  40. this little test successfully.  I did a couple of things at the same time
  41. and ended up fixing my problem.  I'm not sure which one did it, but I decided
  42. to initialize mynetwork as 0 and just before doing the asknode call (I have
  43. another before this one) I set status.all = 0.  The problem is gone and my
  44. code works beautifully.  Sorry to waste the bandwidth.
  45.  
  46. -- 
  47. ===============================================================================
  48. Andrew F. Gunnesch          |  Evil CAEN sysadmin   |  I'm a Sun worshipper
  49. afgun@caen.engin.umich.edu  |What?  I just work here|  not a DEC dog.......
  50. ===============================================================================
  51.