lkml.org 
[lkml]   [2000]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [from the cache]
©2003-2011 Jasper Spaans