From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 2 22:01:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAB3E16A4CE for ; Fri, 2 Jan 2004 22:01:57 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CEDA43D41 for ; Fri, 2 Jan 2004 22:01:57 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id F38365C7F3; Fri, 2 Jan 2004 22:01:56 -0800 (PST) Date: Fri, 2 Jan 2004 22:01:56 -0800 From: Alfred Perlstein To: "David G. Lawrence" Message-ID: <20040103060156.GV9623@elvis.mu.org> References: <20040103005338.GU9623@elvis.mu.org> <20040103054115.GV56722@nexus.dglawrence.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040103054115.GV56722@nexus.dglawrence.com> User-Agent: Mutt/1.4.1i cc: hackers@freebsd.org Subject: Re: [PATCH] sendfile erroniously returns ENOTCONN. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2004 06:01:57 -0000 * David G. Lawrence [040102 21:41] wrote: > > sendfile(8) tries to maintain compatibility with sosend as much as is > reasonable. ENOTCONN is the appropriate error to return if the socket > isn't connected. sosend checks SS_CANTSENDMORE prior to the check for > SS_ISCONNECTED, however, and returns EPIPE in that case. Perhaps sendfile > should be changed to do the same (just a though - I'm not proposing > that this be done). > Removing the check entirely seems clearly wrong, however. I had forgotten that sendfile bypasses sosend(9). I could add the check, is there a reason not to? The one reason I figured was that sometimes blocking sigpipe can be hairy inside libraries. Now that we can selectively disable SIGPIPE using the setsockopt using Apple's code this is less of an issue. -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684