The HyperNews Linux KHG Discussion Pages

More: Dont use system calls within kernel...(esp sys_mlock)

Forum: The Linux Kernel Hackers' Guide
Re: Question Can I make syscall from inside a kernel module? (Shawn Chang)
Keywords: syscall, module, lock physical page
Date: Wed, 26 Nov 1997 13:16:17 GMT
From: Balaji Srinivasan <balaji@hegel.ittc.ukans.edu>

If you want to use a system call within a kernel module then export the system call using EXPORT_SYMBOL macro.

A better solution would be to use mlock in the user space before entering the kernel (ie. write a wrapper function for your entry point that would lock pages in for you before it enters the kernel) This in my opinion is a cleaner solution than exporting sys_mlock.

In addition since sys_mlock acts on the current process it might not have desirable effects in certain cases. Hope this helps balaji