Re: Linux recvfrom() broken (was: DNS problems) (fwd)

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 19 Aug 1998 02:30:48 +0100 (BST)


> If linux has the behaviour it is the only stack that I am aware
> of the behaves this way. The rest return -1 through to the
> buffer size.
>
> DU -1..sizeof(buf)
> BSD 4.2 -1..sizeof(buf)
> BSD 4.3 -1..sizeof(buf)
> Solaris 1 -1..sizeof(buf)
> Solaris 2 -1..sizeof(buf)
> IRIX 6.3 -1..sizeof(buf)
>
> Mind you I personally like the modified behaviour but it does
> break existing code. Having to pass a buffer one octet larger
> than you want to receive to detect overflow is a pain.

You can detect overflow anyway - Use recvmsg and MSG_TRUNC is set on
a BSD style box (not all systems support that tho). There is also
TIOCINQ ioctl to see the size pending.

What I need to know is what Posix intended. If its the sizeof(buf)
interpretation then we should change

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html