Re: core files (was Re: 2.1.131: some quality thoughts)

Jean Zundel (jzu@beru.com)
Tue, 29 Dec 1998 17:49:53 +0100


Simon wrote:

>Well if someone could please give me some pointers as to how you
>actually ask the kernel to "run another task" ie. exec a file.
>I would be more than happy to try to incorperate this into my
>corename patch.
>Remember that I'm fairly new to kernel programming..

kerneld is used mainly to autoload the modules. However, it has an
"inverted fork/exec" facility: the kernel can send a message in a
dedicated message queue (SysV IPC stuff here) with a parameter
saying "please execute the command contained in this message".
Check ipc/msg.c and the modules-* package.

I've been toying with this, as a colleague was mourning over his
lost VMS and the ability to detect the arrival of a file in a
directory for further processing. On Unix, you have to *spool*
(yeuch)... So I said to myself: Yeah! Let's do it! And I almost
did it. Wrote a chunk of code called event.c, put it in kernel/,
patched open.c to have do_open() and sys_close() call relevant
routines, and tried to manage messy pattern/action structures (I'm
a self-taught C programmer)...

Most surprinsingly, it works! Well... it does an "echo OK" on the
console each time a file in /tmp/event/ is opened and closed. It
could do anything actually, provided -- this is my main problem
right now -- that I find a way to feed my pattern/action table,
which is statically coded. We need accessors here.

I'm also _very_ afraid of memory leakage, I've only run a small
test which showed nothing serious (about 5000 events); got to
investigate further.

Now, the _big_ question: is anybody interested?

Code, comments, etc, on my future Web page - got a technical
problem with my provider, but it should be set up by Thursday,
I'll let you know (unless everyone screams "Get off!").

As for my colleague: bad luck, he's on Digital Unix. :-)

Jean

-- 
Jean Zundel | jzu@beru.com | jzundel@dial.oleane.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/