🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.internals
Article #443

RE: Locking down a structure in C

#443
From: Ehud Gavron 602-570-2546
Date: Tue, 17 Nov 1992 06:38
39 lines
1412 bytes
Date sent:  16-NOV-1992 23:36:41



>  Here's another Open VMS Alpha AXP internals C question...
...
>  Now, I'm trying to use a structure...
>
>        static struct
>                {
>                int l_zeep
>                int l_zap
>                int l_zip
>                } zzz ;
>
>  What would be the "best" way to "calculate" the address of the ends of
>  structures to place in a range array for calling sys$lkwset?

Since C structures by definition are contiguous (thanks for the
proof, Bruce!) you know that it is of sizeof(zzz) and at address
zzz.

Therefore given a lock function that locks pages between addresses
1 and 2,
        lock(&zzz,(char *)(&zzz+(char *)sizeof(zzz)));
should work...

>
>Lee K. Gleason N5ZMR
>Control-G Consultants
>gleason@mwk.uucp


Ehud

--
Ehud Gavron        (EG76)
gavron@vesta.sunquest.com                                       This was sent
"The world bores you when you're cool."                         from an Alpha
Technical Details
Message-ID: <921116233823.29a@IT.SUNQUEST.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
From: Ehud Gavron 602-570-2546 <GAVRON@IT.SUNQUEST.COM>
Newsgroups: vmsnet.internals
Subject: RE: Locking down a structure in C
Message-ID: <921116233823.29a@IT.SUNQUEST.COM>
Date: Mon, 16 Nov 1992 23:38:23 -0700 (MST)
Organization: Macro32<==>Vmsnet.Internals Gateway
X-Gateway-Source-Info: Mailing List
Lines: 39