From owner-freebsd-net Wed Dec 13 14:58:29 2000 From owner-freebsd-net@FreeBSD.ORG Wed Dec 13 14:58:26 2000 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from hand.dotat.at (sfo-gw.covalent.net [207.44.198.62]) by hub.freebsd.org (Postfix) with ESMTP id 7CFD637B402; Wed, 13 Dec 2000 14:58:22 -0800 (PST) Received: from fanf by hand.dotat.at with local (Exim 3.15 #3) id 146KqP-00094D-00; Wed, 13 Dec 2000 22:57:53 +0000 Date: Wed, 13 Dec 2000 22:57:53 +0000 From: Tony Finch To: Brian Somers Cc: Alfred Perlstein , arch@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: patch to cleanup inflight desciptor handling. Message-ID: <20001213225753.B30050@hand.dotat.at> References: <200012132124.eBDLOBU68538@hak.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200012132124.eBDLOBU68538@hak.lan.Awfulhak.org> Organization: Covalent Technologies, Inc Sender: fanf@dotat.at Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Brian Somers wrote: > >Hmm, the last time i looked at this, I believe the whole thing was >dealt with by not increasing the file descriptor reference count >when it was put in the message header. If process A closed the >descriptor before process B actually recvmsg()d it, it would be >EBADF. The recvmsg() actually incremented the reference count. But it has always been documented behaviour that the receiving process gets a valid descriptor even if the sender closes it directly after sendmsging it. If this was not the case then descriptor handoff would require an "ok" reply from the receiving process before the sender could close it, which is a pain. Hmm, the only references for this I can think of are Stevens and the red & black daemon books, but I'm sure I've read a good discussion of it somewhere else. Tony. -- f.a.n.finch fanf@covalent.net dot@dotat.at "And remember my friend, future events such as these will affect you in the future." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message