home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / vms / 12642 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.0 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!cdclu1.genrad.com!dongray
  2. From: dongray@cdclu1.genrad.com (Derek Dongray)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: GETDVIW question
  5. Message-ID: <9207221041.AA04045@genrad.com>
  6. Date: 22 Jul 92 10:41:14 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 42
  11.  
  12. [...]
  13. >                                                        One of the things
  14. > that I need to do is check to see if one of the four tape drives is
  15. > online and available. I am using the SYS$GETDRVIW System Service Routine to
  16. > check to see that the drive is NOT allocated, and thus capable of being
  17. > used. My problem is that the VAX that this will be running on is actually
  18. > a VAXCluster, consiting of two nodes. According to the Documentation and
  19. > my own testing, if a drive is allocated to a user on another node, GETDVIW
  20. > is unable to determine whether or not the drive has been allocated.
  21. [...]
  22.  
  23. > Marc Zampetti
  24. > System Administrator - PMW
  25. > Wharton - The University of Pennsylvania
  26.  
  27. My initial thought was to get the device's lock name using $getdvi then use
  28. $enq to try to obtain a lock and if it failed ...
  29.  
  30. Then it occured to me! If all you want to know is "is it allocated?", then
  31. what's wrong with ...
  32.  
  33.     char device[] = "CD4000$MUA0:";        /* cluster served tape */
  34.     $DESCRIPTOR(d_device,device);
  35.     int status;
  36. /*...*/
  37.     status = sys$alloc(&d_device,0,0,0,0);
  38.     if ((status&1)==1) {            /* success of some kind */
  39.         sys$dalloc(&d_device,0);    /* give it back */
  40.         printf("%s is free for allocation.\n",device);
  41.     } else
  42.         printf("%s is currently unavailable.\n",device);
  43. /*...*/
  44.  
  45. Simple and it saves reinventing the wheel! :-)
  46.  
  47. --------------------------------------------------------------------------------
  48. Name : Derek Dongray, Systems Manager, GenRad Ltd.
  49. Phone : 061 486 1511 ext 166
  50. PSS : 234261600119::Dongray                 UKnet : Derek.Dongray@GenRad.co.uk
  51. InterNet : Dongray@cdclu1.GenRad.com        CompuServe : 70374,2745
  52. Address : Monmouth House, Monmouth Road, Cheadle Hulme, Cheshire, SK8 7AY, UK.
  53.  
  54.