Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

shm_open to sys$mgblsc

124 views
Skip to first unread message

Arne Vajhøj

unread,
Aug 24, 2022, 7:31:33 PM8/24/22
to
I assume that shm_open end up calling sys$mgblsc, but how does
the arguments for sys$mgblsc get constructed?

Is the name just used as-is or is it changed?

And what about flags? Just S_IWUSR to SEC$M_WRT or?

Arne

Stephen Hoffman

unread,
Aug 24, 2022, 8:07:09 PM8/24/22
to
I don't think any of that is officially documented.

Which means...

ANALYZE /SYSTEM with the SDA> SHOW GST and SHOW GSD and related
commands, and have a look.

Oh, hey, look, it's another bit of the 32-/64-bit address-space "fun":
"If the application passes its own valid non-zero address, the current
implementation requires this address to be 32 bit; a 64 bit virtual
address is not supported."


--
Pure Personal Opinion | HoffmanLabs LLC

Arne Vajhøj

unread,
Aug 24, 2022, 9:10:25 PM8/24/22
to
On 8/24/2022 8:07 PM, Stephen Hoffman wrote:
> On 2022-08-24 23:31:28 +0000, Arne Vajh j said:
>> I assume that shm_open end up calling sys$mgblsc, but how does the
>> arguments for sys$mgblsc get constructed?
>>
>> Is the name just used as-is or is it changed?
>>
>> And what about flags? Just S_IWUSR to SEC$M_WRT or?
>
> I don't think any of that is officially documented.

:-(

> Which means...
>
> ANALYZE /SYSTEM with the SDA> SHOW GST and SHOW GSD and related
> commands, and have a look.

I did some looking.

And now I am even more confused.

I did not see anything with those commands.

But I did notice a file:

SYS$LOGIN:DECC$SHM_<name specified to shm_open>.;1

????

Arne

Roger Ivie

unread,
Aug 24, 2022, 10:39:20 PM8/24/22
to
On Wednesday, August 24, 2022 at 5:07:09 PM UTC-7, Stephen Hoffman wrote:
> On 2022-08-24 23:31:28 +0000, Arne Vajh j said:
>
> > I assume that shm_open end up calling sys$mgblsc, but how does the
> > arguments for sys$mgblsc get constructed?
> >
>
> Oh, hey, look, it's another bit of the 32-/64-bit address-space "fun":
> "If the application passes its own valid non-zero address, the current
> implementation requires this address to be 32 bit; a 64 bit virtual
> address is not supported."

well, yeah. there's also sys$mgblsc_64 for 64-bit addresses. and
sys$mgblsc_pfn_64 for pfn-mapped sections with 64-bit addresses.
just don't accidentally use sys$mgblsc_64 for your pfn-mapped section,
because the system *will* crash (ask me how i know).
--
roger ivie
roger...@gmail.com

Vitaly Pustovetov

unread,
Aug 25, 2022, 3:20:04 AM8/25/22
to
четверг, 25 августа 2022 г. в 02:31:33 UTC+3, Arne Vajhøj:
> I assume that shm_open end up calling sys$mgblsc, but how does
> the arguments for sys$mgblsc get constructed?
shmp_open only opens/creates a file i.e. fd = open(name, oflag, mode, "shr=del,get,put,upd");
In the next step, you can use mmap and sys$crmpsc/sys$crmpsc_file/sys$crmpsc_file_64/etc are called here.

> Is the name just used as-is or is it changed?
It changes, of course. SYS$SCRATCH:DECC$SHM_ + name

> And what about flags? Just S_IWUSR to SEC$M_WRT or?
Yes, depending on how you need to create the mapping, the SEC$M_GBL, SEC$M_WRT, SEC$M_PAGFIL, SEC$M_CRF, etc. flags are used.

Vitaly

Arne Vajhøj

unread,
Aug 25, 2022, 9:07:16 AM8/25/22
to
On 8/25/2022 3:20 AM, Vitaly Pustovetov wrote:
> четверг, 25 августа 2022 г. в 02:31:33 UTC+3, Arne Vajhøj:
>> I assume that shm_open end up calling sys$mgblsc, but how does
>> the arguments for sys$mgblsc get constructed?
> shmp_open only opens/creates a file i.e. fd = open(name, oflag, mode, "shr=del,get,put,upd");
> In the next step, you can use mmap and sys$crmpsc/sys$crmpsc_file/sys$crmpsc_file_64/etc are called here.

OK.

No way to open a global section mapped to page file?

>> Is the name just used as-is or is it changed?
> It changes, of course. SYS$SCRATCH:DECC$SHM_ + name

I found that file.

>> And what about flags? Just S_IWUSR to SEC$M_WRT or?
> Yes, depending on how you need to create the mapping, the SEC$M_GBL, SEC$M_WRT, SEC$M_PAGFIL, SEC$M_CRF, etc. flags are used.

What triggers SEC$M_PAGFIL to be set?

Arne

Vitaly Pustovetov

unread,
Aug 25, 2022, 1:41:05 PM8/25/22
to
четверг, 25 августа 2022 г. в 16:07:16 UTC+3, Arne Vajhøj:
> No way to open a global section mapped to page file?

I'm not sure but IMHO, no way. I'm going to remake to work with page file the shmget/shmat functions

> What triggers SEC$M_PAGFIL to be set?

MAP_ANON flag

Vitaly

Stephen Hoffman

unread,
Aug 26, 2022, 10:38:49 AM8/26/22
to
Short term, and for upward-compatibility with minimal changes, the
current 32-/64-bit design wins.

Longer term, this addressing hybrid only adds to API chaos.

Everytime I see this design,
On the street in the hollow in the bend,
I see it in my mind and then
I go down the road not taken...again
0 new messages