Re: sock_receive() returning error as EINVAL
Re: sock_receive() returning error as EINVAL
- Subject: Re: sock_receive() returning error as EINVAL
- From: Quinn <email@hidden>
- Date: Fri, 15 Sep 2006 16:09:34 +0100
At 6:36 +0100 11/9/06, sanjay yaragatti wrote:
I am writing a kernel mode driver for a modem.I am
using TCP implementation for the same. The API
sock_receive() and sock_receivembuf() are both
returning error no 22 i.e EINVAL (Invalid
argument).Can anyone please tell me the reason for the
same.. I am attaching the code below for reference..
[Please don't cross post to mailing lists. As I'm not a member of
darwin-drivers, I have no idea whether you got an answer on that
mailing list, so I could be wasting my time be writing the following.
And I kinda hate the thought that I'm wasting my time )-: ]
Did you read the header doc comments in <sys/kpi_socket.h>? There
are certain key statements that you seem to be ignoring. For example:
o In the simplest case, you can just pass NULL to msg.
o msg_iov is ignored.
o On entry, *recvlen is "Maximum number of bytes to receive in the
mbuf chain.", and you've set it to zero.
Finally, my reading of your email indicates that you're receiving
from a TCP socket. If so, you don't need to ask for the sender of
the data (that is, fill out msg_name and msg_namelen); it's going to
be the same as the person you connected to.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden