Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
- Chesney Christ
December 15, 2003, 10:47 pm

I am working on a Linux embedded project at the moment with one simple
small requirement : when a certain event occurs within a kernel driver,
I need to locate a listening user-space process and signal it somehow.
(1) How can I locate the PID of the specific process I want to handle
this ? Can I query for the PID by name ?
(2) Once I have the PID, is it simply a matter of using sys_signal() to
send the signal to the process ?
Thanks in advance for any help possible.
--
"Jokes mentioning ducks were considered particularly funny." - cnn.com
"Jokes mentioning ducks were considered particularly funny." - cnn.com

Re: Sending signals from the kernel to user space

I assume you are writing or at least customising the driver? If so, you
could add an IOCTL call to the driver, which the user program makes to
register its PID with the driver.

send_signal() looks better for this purpose. Get the driver to create
and populate a siginfo and sigpending structures, and pass pointers to
send_signal.
Regards,
John

Re: Sending signals from the kernel to user space
X-No-Archive:yes
A certain John Williams, of comp.os.linux.embedded "fame", writes :

This sounds like it's exactly the ticket. I'll check it out.

Wonderful - exactly the kind of thing I had in mind. Thanks.
A certain John Williams, of comp.os.linux.embedded "fame", writes :

This sounds like it's exactly the ticket. I'll check it out.

Wonderful - exactly the kind of thing I had in mind. Thanks.
--
"Jokes mentioning ducks were considered particularly funny." - cnn.com
"Jokes mentioning ducks were considered particularly funny." - cnn.com

Re: Sending signals from the kernel to user space
The standard way to do a ready message to a user process is using normal
I/O. E.g. a blocking read to the device file done by the user process
could be freed on ready (see e.g. "rtc.c" in the standard distribution
as an example). Moreover (e.g. with a "select" statement and IOCTL) the
user program can inform itself about the state of the device without
being blocked simply using the device file interface.
-Michael

Re: Sending signals from the kernel to user space
X-No-Archive:yes
A certain Michael Schnell, of comp.os.linux.embedded "fame", writes :

The reason why this is a little inappropriate is because I'm supporting
a proprietary network stack, on an embedded Linux setup, which must run
in user space for a number of reasons. So I'm going to have a network
driver in the kernel which will handle and clear the actual interrupts
from the network hardware, and then signal the user space task to come
and collect the data.
A certain Michael Schnell, of comp.os.linux.embedded "fame", writes :

The reason why this is a little inappropriate is because I'm supporting
a proprietary network stack, on an embedded Linux setup, which must run
in user space for a number of reasons. So I'm going to have a network
driver in the kernel which will handle and clear the actual interrupts
from the network hardware, and then signal the user space task to come
and collect the data.
--
"Jokes mentioning ducks were considered particularly funny." - cnn.com
"Jokes mentioning ducks were considered particularly funny." - cnn.com

Re: Sending signals from the kernel to user space
A certain Dan Kegel, of comp.os.linux.embedded "fame", writes :

Thanks for that tip - I just googled for that, and the technique seems
to provide a standard way of implementing this kind of communication -
sounds ideal.
--
"Jokes mentioning ducks were considered particularly funny." - cnn.com
"Jokes mentioning ducks were considered particularly funny." - cnn.com
Site Timeline
- » Problem with Cross Platform Native Debugging
- — Next thread in » Embedded Linux
-
- » Ebedded Linux on a EP7111
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Anybode experience with Nitronic MINISTRIPZH?
- — The site's Newest Thread. Posted in » Electronics Design
-
- » ST7066U et 'busy flag'
- — The site's Last Updated Thread. Posted in » Electronics (French)
-