Xref: utzoo comp.bugs.4bsd:1281 comp.unix.wizards:16495 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.bugs.4bsd,comp.unix.wizards Subject: Re: Shared file descriptors Message-ID: <10341@smoke.BRL.MIL> Date: 30 May 89 16:09:10 GMT References: <1770@taux01.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <1770@taux01.UUCP> gil%taux01@nsc.COM (Gil Shwed) writes: > fork(); > while((n = read(0, buf, 8192)) > 0) > write(1, buf, n); This program has a race condition between the two processes, even in the absence of kernel bugs. > The problem should be fixed by locking the inode before > taking the offset (This is the way SystemV does it). Yeah, it's a problem, isn't it. We begin to see why genuine concurrent programming constructs are useful..