From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 14 Aug 2000 00:50:44 -0400 From: Alexander Viro To: 9fans@cse.psu.edu Subject: Re: [9fans] Potential race in syspipe() In-Reply-To: <200008140430.AAA01256@cse.psu.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Topicbox-Message-UUID: fae012b4-eac8-11e9-9e20-41e7f4b1d025 On Mon, 14 Aug 2000 presotto@plan9.bell-labs.com wrote: > magic in one place. I noticed your snippet didn't check the > need to growfd after getting i, perhaps a good reason for > findfreefd(). Didn't have to, actually - if the first for() would reach the end of array we would have i==f->nfd and the second for() would immediately terminate with j==f->nfd+1. After that we would get the right call of growfd() and correct values at once. But yes, findfreefd() makes the things more obviously correct. [snip] > As for create(), I'ld rather change the man page. Otherwise we'ld > have to reserve an fd in some way before the open but not have that > fd visible to other processes until it was assinged a channel > or let it be step on-able by dup2... Al