From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <7b93f3ae1c310555bed9f828c4639fc7@quanstro.net> From: erik quanstrom Date: Sat, 18 Jul 2009 21:06:12 -0400 To: 9fans@9fans.net In-Reply-To: <1247942380.5366.23.camel@goose.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] i/o on a hangup channel asymmetry Topicbox-Message-UUID: 26ea2fdc-ead5-11e9-9d60-3106f5b1d025 On Sat Jul 18 14:41:02 EDT 2009, rvs@sun.com wrote: > In the "mom, why sky is blue" department, here's a silly question: > is there any good reason that read(2) on a hangup channel returns > an error, while write(2) on a hangup channel terminates an application > (by generating a note, of course, which can be ignored, but still)? hmm. from a quick read of port/sysfile.c, i think the precise behavior might depend on the underlying device. if devtab[m->c->type]->bread/bwrite are (ultimately) based on qbread and qbwrite, i read qio as saying that neither should generate a note. perhaps i've been asleep at the swtch, but i don't recall seing writes on closed channels terminate programs with a note. - erik