[lkml]   [2004]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: how do you call userspace syscalls (e.g. sys_rename) from inside kernel
On Fri, Oct 08, 2004 at 10:02:08AM -0400, Brian Gerst wrote:
> Luke Kenneth Casson Leighton wrote:
> >could someone kindly advise me on the location of some example code in
> >the kernel which calls one of the userspace system calls from inside the
> >kernel?
> >
> >alternatively if this has never been considered before, please could
> >someone advise me as to how it might be achieved?
> What are you trying to do?

call sys_rename, sys_pread, sys_create, sys_mknod, sys_rmdir
etc. - everything that does file access.

> In most cases needing to use syscalls from
> within the kernel is an indication of a design flaw.

in this case it's an attempt to avoid cutting and pasting
the entire contents of sys_rename, sys_pread, sys_this,
sys_that, removing the first couple and last few lines (that
do copy_from_user) and replacing the arguments with either
a dentry or a kernel-side char* instead of an __user char*.

my alternative is to patch every single vfs-related sys_* in fs/*.c to
be able to "plug in" to these functions.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:06    [W:0.055 / U:5.364 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site