RE: how do you call userspace syscalls (e.g. sys_rename) from insidekernel

From: Jirka Kosina
Date: Mon Oct 11 2004 - 05:07:49 EST


On Mon, 11 Oct 2004, Aboo Valappil wrote:

> In the past I looked in to open, read and write a file from a kernel
> module. But problem I faced using the kernel function was that it
> checks for the permissions of the file and path against the "current"
> process. For eg: open_namei() function ... My requirement was to open
> the file regardless of the permissions on the file and also not by
> modifying task_struct of the current process to change the permissions
> first ! I also wanted not associate the file with the current/any
> processes. Any ideas on this ?

1) This is offtopic on LKML, kernelnewbies might be more apropriate list
2) look at set_fs() and filp_open() calls, they might be useful for you
3) Think twice if opening files from kernel is the thing you are willing
to do

--
JiKos.

-
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/