Re: how do you call userspace syscalls (e.g. sys_rename) frominside kernel

From: Fabiano Ramos
Date: Fri Oct 08 2004 - 08:17:21 EST


On Fri, 2004-10-08 at 14:04 +0100, Luke Kenneth Casson Leighton wrote:
> could someone kindly advise me on the location of some example code in
> the kernel which calls one of the userspace system calls from inside the
> kernel?
>
> alternatively if this has never been considered before, please could
> someone advise me as to how it might be achieved?
>

you cannot do that. For every sys_xx there is a do_xx, that can
be called from inside the kernel.

> thank you,
>
> l.
>
> [p.s. i found asm/unistd.h, i found the macros syscall012345
> etc., i believe i don't quite understand what these are for, and
> may be on the wrong track.]

These are are available for you to make syscalls from user mode
without library support (usually that brand new syscall you added).
They are basically wrappers that expand into C code. _syscallx,
where x is the number of arguments the syscall needs.

>

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