lkml.org 
[lkml]   [2004]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: how do you call userspace syscalls (e.g. sys_rename) from inside kernel
    >  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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

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