Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Jan 2004 03:55:42 -0800
From:      Alfred Perlstein <alfred@freebsd.org>
To:        "David G. Lawrence" <dg@root.com>
Cc:        hackers@freebsd.org
Subject:   Re: [PATCH] sendfile erroniously returns ENOTCONN.
Message-ID:  <20040103115542.GW9623@elvis.mu.org>
In-Reply-To: <20040103085515.GR213@nexus.dglawrence.com>
References:  <20040103005338.GU9623@elvis.mu.org> <20040103054115.GV56722@nexus.dglawrence.com> <20040103060156.GV9623@elvis.mu.org> <20040103085515.GR213@nexus.dglawrence.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* David G. Lawrence <dg@root.com> [040103 00:55] wrote:
> > * David G. Lawrence <dg@dglawrence.com> [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.
> 
>    Yes, I think checking for SS_CATSENDMORE (and returning EPIPE) prior to
> checking SS_ISCONNECTED (and returning ENOTCONN as it does now) is the right
> thing to do.

Last question (I hope)... :)

Why not call sosend?

-- 
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright@mu.org cell: 408-480-4684



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040103115542.GW9623>