home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.apollo
- Path: sparky!uunet!caen!afgun
- From: afgun@engin.umich.edu (Andrew F. Gunnesch)
- Subject: Re: Need asknode_$info help
- Message-ID: <sHV-=M#@engin.umich.edu>
- Date: Tue, 28 Jul 92 16:49:37 EDT
- Organization: CAEN, University of Michigan
- References: <RHV-VC#@engin.umich.edu>
- Sender: afgun@engin.umich.edu
- Followup-To: comp.sys.apollo
- Nntp-Posting-Host: beck.engin.umich.edu
- Lines: 37
-
- In article <RHV-VC#@engin.umich.edu> I wrote:
- >#include <stdio.h>
- >#include "/us/ins/ubase.ins.c"
- >#include "/us/ins/asknode.ins.c"
- >
- >main()
- >{
- > network_t mynetwork;
- > status_$t status;
- >
- >
- > asknode_$info(ask_network_number, (node_t)0, 0, &mynetwork, status);
- > /* Ask the node it's network number */
- > if (status.all != status_$ok)
- > fprintf(stderr, "Get network request failed.\n");
- > else
- > printf("%lX\n", mynetwork);
- >}
- >
- >Here's a little bit of code. From ubase.ins.c, network_t is typedef'ed to
- >an unsigned long. The network number that I get back SHOULD be 29cf7, but
- >it varies, and starts with 760. Eg, several different runs produced either
- >7600aca4 or 760de310. What am I doing wrong here?
- >
-
- Well, the code that I posted was taken in chunks out of my program. I ran
- this little test successfully. I did a couple of things at the same time
- and ended up fixing my problem. I'm not sure which one did it, but I decided
- to initialize mynetwork as 0 and just before doing the asknode call (I have
- another before this one) I set status.all = 0. The problem is gone and my
- code works beautifully. Sorry to waste the bandwidth.
-
- --
- ===============================================================================
- Andrew F. Gunnesch | Evil CAEN sysadmin | I'm a Sun worshipper
- afgun@caen.engin.umich.edu |What? I just work here| not a DEC dog.......
- ===============================================================================
-