Send data from kernel to userspace with KEXT control ?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=m56rxugjIqrWTX2kMRAugQdquxBCEnuJ/HRdLtJmuxZ9A11lzXwte2odPiRMD6TS44B63S3aDUbXfSJEVis/MpuKEokE/DLp8YXQVIi6zHnOpx9scADWNuOWFI/oMHnkk7wmJGOnHb53wBCOIRnk6acC7UkAMKqKgI2d9WttIZo= Hi, I have a kext that has some data to send out to userspace. After some time of investigations (great thanks to developers on this ML), I think it is a good idea to employ network stack for this job. To do that, I register a kernel control (ctl_register() function) in kernel, and have an application in userspace. The application will periodically send request for data to kernel. Inside kernel, I have a buffer, and it is necessary to send all the data from the buffer out to the userspace application. However, from the guide "Network kernel extensions programming guide", we read : " ..... the user process can communicate with the control using getsockopt, setsockopt, recv, and send on the socket. With the exception of recv (which is transparently handled with a queue), calls in user space to these functions result in a kernel-space call to the equivalent functions in the control, ctl_getopt_func, ctl_setopt_func, and ctl_send, respectively. ........" So it is not clear how we can handle receive function (recv) from inside kernel? I understand that to send data out (when client requests with recv()), I must handle the buffer for recv(), but I dont know how to do that. Too bad the documentation is quite ambiguity to me. Would anybody help me? Many thanks, H _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
NAHieu