Re: Again:syscall from modules

Trond Myklebust
2001-12-27T18:58:18Z

>>>>> " " == Terje Eggestad <terje.eggestad@scali.com> writes:

> Yes, the sys_* funcs are declared asmlinkage int sys_*. where
> the asmlinkage differ from platform to platform. It's used to
> tell the compiler if a non standared calling convertion is
> used, typically if params are passed by registers instead of
> stack. The asmlinkage define must be sett according to the
> syscall dispatcher (entry.S on ia32), and may be changed
> accordingly.

> In short, if you want to use sys_* you must understand the
> interaction between the sys_* funcs and the dispatcher on
> *every* platform, and the interaction may change without
> notice.

> In short short, don't don't don't don't use the sys_*
> functions.

You are scaremongering a bit here. Several of the sys_* functions
*are* generic, and could be called by quite safely by the kernel. Look
for instance at the use of sys_close() by the binfmt stuff.

Normally, though, there will be a price to pay in terms of an
overhead.
Furthermore, if you find that you absolutely *have* to use the sys_*
interface, from userspace you will probably want to rethink your
design: after all you can call all those sys_* functions from user
space, and the rule of thumb is that if you *can* do something in user
space, you ought to do it there...

Cheers,
Trond