Amos Shapira wrote:
> Hello,
>
> Is it possible to dynamically add a system call (e.g. by a kernel module)?
Sure it is. Now for the more important questions:
1. Is it easy?
2. Is it worth the hassle?
>
> Currently my plan is to add a special file under /proc or /dev which
> any program will be able to open and then pass the arguments through
> ioctl(2).
why not do it the way it's meant to be done, using a custom device?
That's the straight forward way.

If you really really must put in a new syscall, this is the ugly hack
you can do. Note that you may never ever ever unload this hack, no
matter what you do. Here goes:
Install your own interrupt handler on the syscall interrupt number
(memory serve me right, this is 80 on i386 for Linux). Filter out your
own syscall number, pick a syscall number that will never be used by
anyone in the foreseeable future, and if it's not it, call the original
handler.

If you want my advice - go with an ioctl and a custom device. It's
documented, non-hackish, allows unload and is future proof.
>
> Thanks,
>
> --Amos
>
Shachar

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to