Re: Problem in Kernel Socket Read.
Re: Problem in Kernel Socket Read.
- Subject: Re: Problem in Kernel Socket Read.
- From: Quinn <email@hidden>
- Date: Mon, 11 Dec 2006 11:07:29 +0000
At 12:43 +0530 11/12/06, Nandan Nivgune wrote:
I am trying to read and write using Kernel socket in Mac os X
10.4.7; using "Kpi_socket" Header file. It performs connect & write
operation successfully while in case of reading data from socket, it
returns with
error: 35, Resource temporary unavailable.
The obvious cause for this is documented in the header:
@result 0 on success, EWOULDBLOCK if non-blocking and operation
would cause the thread to block, otherwise the errno error.
If you look in "/usr/include/sys/errno.h", you'll see that error 35
is EAGAIN which is equivalent to EWOULDBLOCK.
You can confirm the non-blocking status of a socket using
sock_isnonblocking. If the sock is, in fact, in non-blocking mode
and you want it to be in blocking mode, use <x-man-page://2/ioctl>
with the FIONBIO selector to set it to be blocking.
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