[Info-vax] VAX VMS going forward

Craig A. Berry craigberry at nospam.mac.com
Sat Aug 1 11:41:38 EDT 2020


On 8/1/20 8:21 AM, David Jones wrote:
> On Friday, July 31, 2020 at 6:52:29 PM UTC-4, Craig A. Berry wrote:
>> On 7/31/20 4:05 PM, David Jones wrote:
>>> If the header files have the proper prototypes, the compile will flag the calls
>>> with pointer mismatch warnings.
>> So say you have a program with a 64-bit argv array and it invokes
>> various other programs via execv(). What happens when the main()
>> function of one of those programs expects a 32-bit argv array and it
>> gets your 64-bit array?
>>
> The programs in the spawned processes start over and will build an argv[]
> based on the pointer size qualifier used to compile those programs. There's
> no cloning of memory like Unix fork.

>> Now maybe the whole command line is flattened into a single string,
>> reparsed by DCL, and passed to the invoked program. That would be
>> horrible, but it would avoid the problem of mismatched argv pointer sizes.
> 
> I think argv and envp are passed by mailbox to the spawned process.
> 
> In real life, like I said, the compiler will emit warnings when you compile a
> program that passes an array of long pointers to execv(). 

The context was the possible addition of 64-bit versions of the CRTL
functions that do not currently have 64-bit variants.  The compiler
would not emit warnings when passing an array of long pointers to the
(as-yet hypothetical) 64-bit version of execv().  In fact, it would emit
warnings if you gave it anything else.

Now if the strings the long pointers point to are passed to the child
via mailbox messages, then as long as the mailbox message format is the
same regardless of pointer size, I guess differing pointer sizes
wouldn't be an impediment.




More information about the Info-vax mailing list