On 7/12/06, alfred hitch <alfred.hitch@xxxxxxxxx> wrote:
Hi Folks, I have to "maintain" an existing kernel module code. It was written for 2.4 and has a open, read and write calls from inside kernel module. sample code being this: // memory management segment access fs = get_fs(); set_fs(KERNEL_DS); // open the file with the firmware for PIC for uploading if (ifp = open( filename, O_RDONLY, 0 ), ifp < 0) { Now, when I am trying to compile same code for 2.6, I am getting compilation warning and load time error saying Undefined Symbol: open, read not found .. I know that ideally one isn't supposed to file operations from inside kernel modules. But, this time case is diff. and I have to try to maintain code legacy (please dont ask me why) So, without getting into that debate could someone please help me understand what am I missing. Can I use open, read call like 2.4 here or not ?? If not, why ?? What other options do I have ? TIA, Alfred -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
I didn't write any code to test this, but I think that you just need to call the functions as they are called on the syscall table. If I'm not wrong, something like sys_open, as they appear on arch/i386/kernel/syscall_table.S. You may also need to include include/linux/syscalls.h Daniel -- What this world needs is a good five-dollar plasma weapon. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/