Re: Again:syscall from modules

Trond Myklebust (trond.myklebust@fys.uio.no)
Thu, 27 Dec 2001 19:57:46 +0100


>>>>> " " == 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/