Messages in this thread |  | | Date | Wed, 20 Sep 2000 13:44:21 +0100 (BST) | From | Tigran Aivazian <> | Subject | Re: Function calls not permitted in kernel code |
| |
On Wed, 20 Sep 2000, Mark James wrote:
> That is, can a kernel module open and read files or sockets, > call libc functions, start processes?
kernel code is, as userspace one, just a code to be executed by the CPU, I suspect you knew that already ;) Therefore, it can do absolutely anything the human tells it to. Even calling "libc functions" as long as you implement the desired libc functionality in the kernel yourself - most of what is needed is there already, e.g. sprintf() etc.
Having said that, doing things like opening files and sockets is usually frowned upon and rightly so, except in special cases like khttpd and such.
> (1) Get a user process to do the work, communicating > with the kernel via /proc or some other way.
some other way may be by means of system calls. System calls are the most natural (by definition) way of communicating between userspace and kernel.
Regards, Tigran
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |