On Tue, Apr 27, 2010 at 9:57 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote: > On Tue, Apr 27, 2010 at 09:25, rahul patil > <rahul.deshmukhpatil@xxxxxxxxx> wrote: >> Though it is bad idea to call a system call from kernel space >> is it possible any how to call a system call from kernel space? > > IIRC, don't forget to set the code and data segment. I forgot the > function names, sorry. You'll need it to avoid error checking knowing > that these syscalls are called from outside user space virtual memory > segment. > I think Mulyadi is referring to these sequence of steps: fs = get_fs(); /* save previous value */ set_fs (get_ds()); /* use kernel limit */ /* system calls can be invoked */ set_fs(fs); /* restore before returning to user space */ Refer : http://www.linux.it/~rubini/docs/ksys/ksys.html > -- > regards, > > Mulyadi Santosa > Freelance Linux trainer and consultant > > blog: the-hydra.blogspot.com > training: mulyaditraining.blogspot.com > > -- > To unsubscribe from this list: send an email with > "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx > Please read the FAQ at http://kernelnewbies.org/FAQ > > -- Regards, Sandeep. “To learn is to change. Education is a process that changes the learner.” -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ