[Info-vax] Looking into C-include files on VMS

Martin Vorlaender mv at pdv-systeme.de
Mon Nov 9 11:32:58 EST 2009


Joerg Schilling <js at cs.tu-berlin.de> wrote:
> Bill Gunshannon <billg999 at cs.uofs.edu> wrote:
>> Then, what exactly is the reason VMS can't do a Unix style fork()?
>
> It would help a lot already if vfork() on VMS did work like vfork()
> and did not share file descriptors between parent and child.
>
> More then 90% of all calls to fork() do this with the intention to
> call exec*() soon, but many of these calls like to redirect I/O
> for the new process.
>
> With a real vfork() you may use vfork() in all these cases as long as
> you do not use stdio in the child and as long as you call _exit()
> instead of exit() in the child in case if a problem. On VMS, you would
> need to dup2() descriptors 0/1/2 to other numbers before redirecting
> 0/1/2 for the new process _and_ you would need to restore 0/1/2 in the
> parent. The latter makes it hard to suport I/O redirection in typical
> software.

That's what the HP C RTL has decc$set_child_standard_streams() for, see
http://h71000.www7.hp.com/doc/83final/5763/5763pro_029.html#decc_set_child_routine

cu,
   Martin
-- 
One OS to rule them all       | Martin Vorlaender  |  OpenVMS rules!
One OS to find them           | work: mv at pdv-systeme.de
One OS to bring them all      |   http://vms.pdv-systeme.de/users/martinv/
And in the Darkness bind them.| home: martin.vorlaender at t-online.de



More information about the Info-vax mailing list