Notifying a user space application

3 messages, 2 authors, 2004-07-01 · open the first message on its own page

Notifying a user space application

From: Christian Tröster <hidden>
Date: 2004-06-30 22:29:05


Hi!

I'd like to notify a user space application if an interrupt occurs. I had no
problems to install a custom signal handler but I am not sure what's the best
way to notify the application.

My first idea was to send a signal to the application. But as far as I know
one has to know the pid to send the signal. So I'd need some mechanism to get
this pid - perhaps via a /proc entry. Is this a clean solution?

Another idea was to create a (blocking) character device and have the
application listening on that using select() or something like that. But this
seems to be a little bit bloated just for one signal. :)

Are there any other better ways I am not yet aware of. What do you think?

Bye, Christian

- --
| Mail: c dot troester at gmx dot de | PGP-Id: FA006C74 |

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Notifying a user space application

From: Stefan Nickl <hidden>
Date: 2004-07-01 06:20:47

On Thu, 2004-07-01 at 00:29, Christian Tröster wrote:
Hi!

I'd like to notify a user space application if an interrupt occurs. I
had no
problems to install a custom signal handler but I am not sure what's
the best
way to notify the application.
Mostly a stripped-down ppdev.

-- 
Stefan Nickl
Kontron Modular Computers

Re: Notifying a user space application

From: Christian Tröster <hidden>
Date: 2004-07-01 12:33:54

Hi Stefan!

Stefan Nickl schrieb:
On Thu, 2004-07-01 at 00:29, Christian Tröster wrote:
quoted
I'd like to notify a user space application if an interrupt occurs. I
had no
problems to install a custom signal handler but I am not sure what's
the best
way to notify the application.
Mostly a stripped-down ppdev.
Thanks for posting your code. It works perfectly. I only had to change
one line adding an initialization value for the spin lock.
/*
 * Open the device. It is single-open.
 */
int wfi_s_count = 0;
spinlock_t wfi_s_lock;
spinlock_t wfi_s_lock = SPIN_LOCK_UNLOCKED;
static int wfi_open (struct inode *inode, struct file *file)
{
        file->private_data = &wfi_global;
Bye, Christian

--
| Mail: c dot troester at gmx dot de | PGP-Id: FA006C74 |

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help