Re: kern_control KPI and socket reads
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gTvxrdrUV4pkLiA8aSrcDjTt6jAAKJ80LQw2mLHjWIbyQ9KhkVbIhxxBtFuiJ8VK+9GwECnau2dLKlEwWTllibb1xYbY3wU9YotuaVX+0JXAGtLmdXDJGx37RlJQsxUyeKyk5RqdMZWdZ7gwJYOpImOWeskxrUwXkTQ1m0GCx34= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ty82EjK9lS7SjCLTzO63ptgz0SQmo8WDhe+MklklL3oImoLn6UNWKhV1Ju457uw1Uin9VmRjh1MPjzuy2TfcZZvQoDtj0jveEP0JI+EQJca1iAa3kiL4AZwzNOePQe49KVZbiqiH/G5cB0YC0hn8x7/jGO1S54qXf2M/xQjRfW0= On Mar 14, 2007, at 4:22 PM, Bhavesh Davda wrote:
I know that the kern_control API doesn't provide a callback for reads on the sockets that it internally uses, after a call to ctl_enqueuembuf().
But how would I go about implementing something that gets called on a read/recv from my kern_control socket? You wouldn't, as this entirely defeats the point of having a decoupled reader/writer model. There are plenty of synchronous user/kernel interfaces (socket ioctl in your case, perhaps). Or, since the control socket protocol is entirely under your control, you could require the reader to write an 'ack' packet.
Yeah, I was trying to avoid having 2 system calls for every read(2): a read(2) and an ioctl(2)/setsockopt(2), to get this functionality. Alternatively, I was wondering how many people would throw up at the idea of using a getsockopt(2) to read(2) data out of the kern_control socket :-). I'm not even sure I can do that, because the kern_control KPI doesn't expose a way to "dequeue" from the underlying socket, or even to get to the underlying socket for that matter. Thanks -- Bhavesh P. Davda _______________________________________________ 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 3/15/07, Michael Smith <drivers@mu.org> wrote: = Mike This email sent to site_archiver@lists.apple.com
participants (1)
-
Bhavesh Davda