lkml.org 
[lkml]   [1999]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Calling userspace function from inside kernel (still) possible?
    Arjan Opmeer wrote:
    > I am wondering whether it is possible to call a userspace routine from
    > within the kernel, say a module or something.
    > The Linux Kernel Hacker Guide states as one solution to call kerneld from
    > kernel mode and have it execute a seperate program.
    > Since kerneld had been replaced with kmod, and the kmod documentation
    > states it can only be used to load modules on demand this solution clearly
    > is not an option anymore.
    >
    > ( Little background info: I am thinking about an extension to the kernel via
    > a kernel module. Userspace processes can register themselves with that
    > module and be called whenever some condition in the kernel is met. When
    > someone has another idea about how to handle this situation I would
    > certainly like to hear it. )

    The closest thing to what you are looking for is a callback to a signal
    handler. Currently there are no other kernel->user callbacks for an
    already running process. Kerneld used SysV IPC, but it was a gross hack
    so that's not really an option. You could try to have the kernel raise
    a signal to the process (say SIGUSR1), and that signal handler would
    handle the event. Or, you could have your module register a character
    device and let the processes poll the device node for events.

    --

    Brian Gerst

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

    \
     
     \ /
      Last update: 2005-03-22 13:50    [W:4.137 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site