[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Yet, another question about writing a module.....
Aiee :)
Hello!
On Fri, Feb 16, 2001 at 04:39:20PM +0530, aprasad@in.ibm.com wrote:
> try this
>
> struct file *filp;
> mm_segment_t old_fs;
> filp = filp_open(name,flags,mode);
> old_fs= getfs();
> set_fs(KERNEL_DS);
> filp->f_op->read(filp,buffer,count,&filp->f_pos);
Question:
Is it a bad practice to use one of the _syscallX macro to `declare'
(i.e. to use) an existant syscall like open(2), read(2) instead of
the above solution?
I mean, since we're in kernel land, using the open(2) syscall for example
will raise the int 0x80, which is used to switch in kernel land (but we're
already in kernel mode).
Is this something to avoid? Why (performance issues, possible panic)?
(Didn't tried it, sorry).
bye bye
-- gg sullivan
--
Lorenzo Cavallaro `Gigi Sullivan' <sullivan@sikurezza.org>
LibRNet Project Home Page: http://www.sikurezza.org/sullivan
LibRNet Mailing List: librnet-subscribe@egroups.com
Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml