How to access a user space file from kernel space in FreeBSD.
Jan Bramkamp
crest at rlwinm.de
Fri Mar 20 17:40:01 UTC 2020
On 20.03.20 15:40, Arpan Palit wrote:
> Hi all,
>
> I am working on (kernel)driver ioctl implementation for file read/write,
> where I need to know what are API's which can expose to read,write and
> close user space file from kernel space. In general I need to know the
> answer for the below questions.
>
> i). How to open a user space file from driver(kernel space) ?
> ii). How to create a new user space file from driver(kernel space) ?
> iii). How to get file parameters like size of the file ?
> iv). How to read/write the files from the driver(kernel space) ?
What you ask can be done inside the kernel, but it doesn't sound like a
good design choice for a device driver. I suspect there are better ways
for a (device) driver to to interact with the rest of the system. If you
want to write a device driver I would recommend that you to backtrack
and describe what problem you want solve instead of how you attempted to
solve it. Should you want to learn about corner cases in the kernel
that's fine too.
More information about the freebsd-hackers
mailing list