Re: how do you call userspace syscalls (e.g. sys_rename) from insidekernel

From: Brice Goglin
Date: Fri Oct 08 2004 - 10:23:04 EST


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

If you ever actually call sys_this or sys_that ... from
the kernel, you'll have to do something like this to avoid
copy_from/to_user to fail because the target buffer is not
in kernel space:

mm_segment_t old_fs;
old_fs = get_fs();
set_fs(KERNEL_DS);
<do you stuff here>
set_fs(old_fs);

Just look for set_fs in the kernel source to find examples.
--
Brice Goglin
================================================
Ph.D Student
Laboratoire de l'Informatique et du Parallélisme
CNRS-ENS Lyon-INRIA-UCB Lyon
France
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/