🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1392

Re: Shared file descriptors

#1392
From: Doug Gwyn
Date: Tue, 30 May 1989 16:09
13 lines
895 bytes
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..
Technical Details
Message-ID: <10341@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!ames!haven!adm!smoke!gwyn
References: <1770@taux01.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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