Re: apropos recvfrom

Andi Kleen (ak@muc.de)
16 Oct 1998 16:12:57 +0200


In article <Pine.LNX.3.96.981015214337.6013A-100000@apemaia.roma1.infn.it>,
Davide Rossetti <rossetti@apemaia.roma1.infn.it> writes:
> hi all,
> On Linux 2.1.125 (not sure, but also on 2.0.35)
> I beg your pardon for my silliness. Now I got a strange result.
> 1) client side:
> sendmsg() with
> msg_iov = array of 3 iovec
> msg_iovlen= 3
> it returns 3 !!!

> 2) server side:
> recvmsg() with
> msg_iov = array of 2 iovec
> msg_iovlen = 2
> it returns 3 !!! (msg_flags==0)

> browsing http://www.opengroup.org/onlinepubs/7908799/xns/recvmsg.html,
> it seems that both functions should return the total recvd/sent bytes.
> Am I wrong ?
> In case I am, how can I get the exact fill status of my recvd iovecs,
> that is, how many bytes got received ?

You do. The result means that the datagram only carried 3 bytes of payload.
How you map that to your iovs is a user space problem.

-Andi

-
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.tux.org/lkml/