🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: vmsnet.internals
1 messages
1 total messages Started by Ehud Gavron 602-570-2546 Tue, 17 Nov 1992 06:38
RE: Locking down a structure in C
#443
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads