home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / vmsnet / internal / 1597 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.3 KB

  1. Path: sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
  2. From: Ehud Gavron 602-570-2546 <GAVRON@IT.SUNQUEST.COM>
  3. Newsgroups: vmsnet.internals
  4. Subject: RE: Locking down a structure in C
  5. Message-ID: <921116233823.29a@IT.SUNQUEST.COM>
  6. Date: Mon, 16 Nov 1992 23:38:23 -0700 (MST)
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 39
  10.  
  11. Date sent:  16-NOV-1992 23:36:41
  12.  
  13.  
  14.  
  15. >  Here's another Open VMS Alpha AXP internals C question...
  16. ...
  17. >  Now, I'm trying to use a structure...
  18. >
  19. >        static struct
  20. >                {
  21. >                int l_zeep
  22. >                int l_zap
  23. >                int l_zip
  24. >                } zzz ;
  25. >
  26. >  What would be the "best" way to "calculate" the address of the ends of
  27. >  structures to place in a range array for calling sys$lkwset?
  28.  
  29. Since C structures by definition are contiguous (thanks for the
  30. proof, Bruce!) you know that it is of sizeof(zzz) and at address
  31. zzz.
  32.  
  33. Therefore given a lock function that locks pages between addresses
  34. 1 and 2,
  35.         lock(&zzz,(char *)(&zzz+(char *)sizeof(zzz)));
  36. should work...
  37.  
  38. >
  39. >Lee K. Gleason N5ZMR
  40. >Control-G Consultants
  41. >gleason@mwk.uucp
  42.  
  43.  
  44. Ehud
  45.  
  46. --
  47. Ehud Gavron        (EG76)
  48. gavron@vesta.sunquest.com                                       This was sent
  49. "The world bores you when you're cool."                         from an Alpha
  50.