This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: bsd_write() returns EINVAL
- From: "Gary D. Thomas" <gary dot thomas at mind dot be>
- To: Roland Caßebohm <roland dot cassebohm at visionsystems dot de>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 03 Jan 2003 08:49:20 -0700
- Subject: Re: [ECOS] bsd_write() returns EINVAL
- References: <200301031642.14658.roland.cassebohm@visionsystems.de>
On Fri, 2003-01-03 at 08:42, Roland Caßebohm wrote:
> Hi,
>
> I'm using the OpenBSD stack.
>
> I have the following problem:
> The write() function returns EINVAL, if the TCP connection is close from the
> client.
> Is this right?
What would you have it return? Note that this value (EINVAL) is
unchanged from what the actual BSD code uses (in other words, I
didn't change it for eCos).
Also note that the new stack (the FreeBSD one) handles this differently.
>
> The following code in tcp_usrreq() generates the error:
>
> inp = sotoinpcb(so);
> /*
> * When a TCP is attached to a socket, then there will be
> * a (struct inpcb) pointed at by the socket, and this
> * structure will point at a subsidary (struct tcpcb).
> */
> if (inp == 0 && req != PRU_ATTACH) {
> splx(s);
> /*
> * The following corrects an mbuf leak under rare
> * circumstances
> */
> if (m && (req == PRU_SEND || req == PRU_SENDOOB))
> m_freem(m);
> return (EINVAL); /* XXX */
> }
>
--
.--------------------------------------------------------.
| Mind: Embedded Linux and eCos Development |
|--------------------------------------------------------|
| Gary Thomas email: gary.thomas@mind.be |
| Mind ( http://mind.be ) tel: +1 (970) 229-1963 |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc |
'--------------------------------------------------------'
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss