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

Richard B. Gilbert rgilbert88 at comcast.net
Mon Nov 9 11:17:13 EST 2009


Joerg Schilling wrote:
> In article <7llbk1F3eetdpU1 at mid.individual.net>,
> 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.
> 

Learn to live with it.  VMS doesn't have fork() or vfork() because it 
works without either one.  VMS has been in use for about thirty years 
now without fork().  I learned to program without fork() on IBM 
System/360, moved to H-P 2100 series without fork() and then to VAX/VMS 
still without fork().  I even managed to write a few programs for 
Silicon Graphics IRIX without using fork.





More information about the Info-vax mailing list