I want to write a module that opens up a device (known to the userland filesystem as "/dev/mtd/0"), runs some ioctl()s on it, and writes some data to it. There are two problems: 1. the functions I want to use (which are defined in drivers/mtd/mtdchar.c) are static, so my module can't link to them. I guess I could get to them by somehow searching the VFS dispatch table (which I don't really understand). 2. these mtd functions need arguments like "struct file *file" which are normally passed by the kernel when a userspace program invokes write() or ioctl(). My module doesn't have those either. It seems to me that if it is easy in userspace it should also be easy in a module. What's the best way to call write() and ioctl() on a device from my module? Thanks, Dave -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/