Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!decvax!ucbvax!richardson_j@seismo.CSS.GOV@summer.su.OZ.AU
From: richardson_j@seismo.CSS.GOV@summer.su.OZ.AU
Newsgroups: mod.computers.vax
Subject: Output file sharing by C child processes
Message-ID: <8612220638.AA15514@seismo.CSS.GOV>
Date: Mon, 22-Dec-86 14:28:18 EST
Article-I.D.: seismo.8612220638.AA15514
Posted: Mon Dec 22 14:28:18 1986
Date-Received: Mon, 22-Dec-86 05:35:18 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 28
Approved: info-vax@sri-kl.arpa

We have a problem with C programs in which a parent and child process both need
to write to the same file.  RMS now allows multiple writers to all file types
(since VMS verion 4.4), and DEC C allows extra arguments to fopen() to specify
file sharing options.  Parent and child execute their fopen() and fprintf()
calls without error, but the parent's output obliterates anything written by the
child. 

Note that when the output device is a terminal, all works fine, as illustrated
by the first example in Chap 24 of the C Manual.  The problem appears when
output is to a disk file, e.g., if the example mentioned is run in a batch job
so that stdout is the logfile, or in cases where a disk file is specifically
fopened.

Has anybody else encountered this problem and found a work-around?  We are
trying to port a large Unix program to VMS, and this bug seems to be the only
significant obstacle. 

We are running VMS V4.5.

Thanks in advance,

Jim Richardson, Alec Dunn

--
Jim Richardson
Department of Pure Mathematics, University of Sydney, NSW 2006, Australia
UUCP:	...!seismo!munnari!summer.oz!jimr
ARPA:	jimr%summer.oz@seismo.arpa	ACSNET, CSNET:	jimr@summer.oz