[snip]
> So what happens if a program with a DCB open for INPUT performs a
> fork()?  Does fork() leave a blank space where the DCB was?  What
> happens if the child performs a READ?  Something ought to fail
> because the parent may have scratched the data set and the child
> would be reading unallocated DASD tracks.  Repeat the question
> with OUTPUT in place of INPUT.  If the parent has a descriptor of
> a UNIX file, the child inherits it with no problem: the disk
> blocks are not freed until some process unlinks the file and
> both the parent and child close it.  (But what if YA process
> opens it with O_TRUNC?)
> 
> -- gil

IIRC, the z/OS control structures associated with legacy I/O (DEBs, etc)
are not propogated to the child. Now, the DCB is "copied" (like it's in
the program or in STORAGE OBTAIN'ed memory in key 8), but the associated
DEB is not. So if the child does any I/O using the DCB, it will fail
with some sort of error (don't know what, haven't tried).

The O_TRUNC option applied when the UNIX file is opened. The child gets
an already opened file descriptor. So the file is not opened a second
time, so the O_TRUNC is not done.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.  

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to