Re: Problem in Kernel Socket Read.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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. Also, you should wean yourself off mixing up: ENOTSUP - Operation not supported EOPNOTSUPP - Operation not supported on socket -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Dec 11, 2006, at 3:07 AM, Quinn wrote: 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. If you look in "/usr/include/sys/errno.h", you'll see that error 35 is EAGAIN which is equivalent to EWOULDBLOCK. This will not necessarily be true forever; the proper errno for sockets is EWOULDBLOCK, please use EWOULDBLOCK in case it gets changed out from under you at some point. the second is always for sockets (except for lchown; the POSIX standard is sort of broken for that one API). Generally EAGAIN and ENOTSUP are private to file calls. If you don't know what an fd you are calling is attached to (because you don't remember from when you got it), you can always call fstat to ask. 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/tlambert%40apple.com This email sent to tlambert@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert