Re: How to retrieve buffer from struct uio ?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=6cji+MKpSx645otmHwUw86lF7IhDsmiI5PgqwPKaZVyVucsiiyiG8W1felm9BrDTNSKfnzZFzqJrmsiZVhNK9ext7fvpxQoR9+wbaT1ETMhzRCx6a3KOnBLnlBqM/BXQHjr6HhbMjQdD7pWm9r/WsXGCgM8MDICmQbCrbwh+Ihw= ; Thanks Terry. Now i am able to retrieve the buffer from the struture uio.Thanks a lot for providing pointers :-) Regards, Sanjay --- Terry Lambert <tlambert@apple.com> wrote:
On Sep 12, 2006, at 2:13 AM, sanjay yaragatti wrote:
Hi all, I am writing a kernel driver.I have
regestered it
as character device. I am unable to implement the device write method (dev_write( dev_t device, struct uio *uio, int ioflag)) since I don't know how to retrieve the buffer from struct uio.
However on trying to dereference uio as uio->uio_iov->iov_base gave a compilation error.
Is there a KPI to retrieve the buffer sent from user space?
You may want to read /usr/include/sys/uio.h...
/* * uio_curriovbase - return the base address of the current iovec associated * with the given uio_t. May return 0. */ user_addr_t uio_curriovbase( uio_t a_uio );
You can also look at the kernel sources; in this case, the function is implemented in:
<http://www.opensource.apple.com/darwinsource/10.4.7.ppc/xnu-792.6.76/bsd/ker...
-- Terry
__________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ _______________________________________________ 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)
-
sanjay yaragatti