Re: how to take password in kernel model...
- From: Nix <nix-razor-pit@xxxxxxxxxxxxx>
- Date: Wed, 07 Dec 2005 17:03:30 +0000
On Mon, 5 Dec 2005, Peter T. Breuer spake:
> shiva <nikhilbhargav_nsit@xxxxxxxxxxxxx> wrote:
>> IS there a way I could use proc file system to know hte
>> filetype--application association...
>
> Yep - easy: there isn't one.
.... or at least not a stable one, and *definitely* not one the kernel
should be concerned with.
If you were completely crazy you could have something where the
kernel calls out to userspace to run file(1) over the file, perhaps
exporting the result as a synthetic xattr. But this would still be
mostly useless because apps would need modification to read your
synthetic xattr in any case, and if you're changing them to do that
you might as well change them to call file(1) themselves (which is
more portable, to boot).
If you need speed and don't care so much about portability to systems
with different file(1) implementations, you can have your apps link
directly to libmagic.so and use the functions in <magic.h>. That'll be
faster than *any* kernel implementation because you don't have to fork
at all. (It would even be faster than some hideous thing which
reimplements file(1) in kernel space because you're eliminating the,
admittedly tiny, system call overhead.)
This is really, really, *really* not a job for the kernel.
--
`Y'know, London's nice at this time of year. If you like your cities
freezing cold and full of surly gits.' --- David Damerell
.
- References:
- how to take password in kernel model...
- From: shiva
- Re: how to take password in kernel model...
- From: parag . warudkar
- Re: how to take password in kernel model...
- From: shiva
- Re: how to take password in kernel model...
- From: Peter T. Breuer
- how to take password in kernel model...
- Prev by Date: Re: how to take password in kernel model...
- Next by Date: Re: /dev/fanout : A one-to-many multiplexer (beta)
- Previous by thread: Re: how to take password in kernel model...
- Next by thread: Re: how to take password in kernel model...
- Index(es):
Relevant Pages
|