Hello, Is it possible to dynamically add a system call (e.g. by a kernel module)?
As far as I'm familiar with the kernel internals I'd say that the answer is "no" but just in case I missed something I would like to hear from the experts. I know that system calls are identified by numbers which are basically indexes into the sys_call_table array which seems to be compiled statically with the kernel source, and I can't find anywhere any internal kernel API which changes this table. The goal of this is that I'd like to add a way to do kernel-level operation (e.g. given a file name, do a special filesystem operation on it) which is most natural to do by inventing a new system call. I don't expect my code to get integrated into the kernel (not at initial stage, at least) but I'd still like to make it possible for users to say "uhh ohh, I'd like to make this operation now, without having to reboot to a special kernel" and be able to download/compile/install a kernel module which will enable this operation. There is no way to do this operation any other way than to add some kernel-level code (there is no way to achieve this through existing system calls or other kernel code). 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). Thanks, --Amos