Re: sys_open and sys_lseek
From: Gerhard W. Gruber (sparhawk_at_gmx.at)
Date: 11/23/03
- Next message: Kasper Dupont: "Re: Processes and memory"
- Previous message: Kasper Dupont: "Re: beginning linux driver development"
- In reply to: Kasper Dupont: "Re: sys_open and sys_lseek"
- Next in thread: Kasper Dupont: "Re: sys_open and sys_lseek"
- Reply: Kasper Dupont: "Re: sys_open and sys_lseek"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 23 Nov 2003 10:03:19 +0100
On Sun, 23 Nov 2003 00:48:10 +0100 wrote Kasper Dupont <kasperd@daimi.au.dk>
in comp.os.linux.development.system with <3FBFF5BA.C6DACF4A@daimi.au.dk>
>You are making multiple mistakes. Using filedescriptors in kernel
>space is one, using lseek to find the size of a file is another:
>
>http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#filp_open
Thanks. Previously I was using the filp_* functions, but then I browsed a
little bit and found a page wich basically said that sys_* are exactly for
that reason. To have file IO from within kernel space. It only said that the
module must be prepared to sleep while doing IO, but that is not exaclty a
problem in that case, as I only need it for initialization.
Does this mean there is no way to determine the size? Well, I can live without
it, so I have to rewrite the code to take this into account. And what about
truncating a file? What happens when I rewrite a file and it is shorter. What
do I do with the excess data? Also I wonder why it is frowned upon to do file
IO from kernel space. This is a service which is available anyway, so why
should kernel modules not use it if they need it?
-- Gerhard Gruber Maintainer of SoftICE for Linux - http://sourceforge.net/projects/pice Fast application launcher - http://sourceforge.net/projects/launchmenu
- Next message: Kasper Dupont: "Re: Processes and memory"
- Previous message: Kasper Dupont: "Re: beginning linux driver development"
- In reply to: Kasper Dupont: "Re: sys_open and sys_lseek"
- Next in thread: Kasper Dupont: "Re: sys_open and sys_lseek"
- Reply: Kasper Dupont: "Re: sys_open and sys_lseek"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]