From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 17 Aug 2004 17:12:28 -0400 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>, Dave Presotto Subject: Re: [9fans] accept in dial(2) In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Cc: Topicbox-Message-UUID: d5d7b86e-eacd-11e9-9e20-41e7f4b1d025 [I forwarded geoff's original post to Dave Presotto, who is not reading 9fans as vigorously as usual. I'm posting this because his gmail account is not authorized to send to 9fans.] From: David Presotto To: 9fans@cse.psu.edu Date: Tue, 17 Aug 2004 13:06:18 -0700 Subject: Fwd: [9fans] accept in dial(2) I'm indeed only reading 9fans sporadically. The fd used should indeed be the one returned by listen. aux/listen et al are wrong. However, since we shut off datakit, it really hasn't mattered because we currently don't have the ability to reject IP calls. Should someone change that, listen et al should be changed to use nctl. On Mon, 16 Aug 2004 20:30:48 -0700, geoff@collyer.net wrote: > There seems to be some confusion about which file descriptor > accept should take as its first argument: the one announce > returned, the one listen returned, or it doesn't matter. > A quick kernel grep suggests that only port/devsdp.c still > recognises the word "accept", per the comment > > write(ctl, buf, n); /* ignore return value, network might not need accepts */ > > at /sys/src/libc/9sys/announce.c:148. dial(2) says > ``Accept accepts a call received by listen'', which > isn't completely clear, but the example given uses > the fd returned by listen, which makes sense to me. > On the other hand, listen, listen1 and tftpd use the > fd returned by announce. > > Does anybody know which fd accept should take, and if it > matters? >