LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-02-2005, 12:38 PM   #1
andreiij
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
trying to send signal from linux module


Hi!
I have a kernel (linux 2.6.11.7) module.
I want this module, upon recieving an interrupt, to send a signal to a user process. How do i do that?
The module recives the pid of the user process via its proc file.
This dosent seem to work, any other ideas?

my_interrupt_handler() {

struct task_struct *p;
p = find_task_by_pid(pid_of_client);
force_sig(SIGUSR1, p);
}

the int pid_of_client is correct..



thanks!
/andy
 
Old 05-02-2005, 12:46 PM   #2
andreiij
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Ok... I found answer to my own question..

had to use get_task_struct(struct task_struct) also.. the code now looks like

p = find_task_by_pid(pid_of_client);
if (p)
{
get_task_struct(p);
force_sig(SIGUSR1, p);
}

Thanks anyway!
/andy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to send user defined signal in linux feetyouwell Linux - Software 6 12-26-2007 04:40 AM
how to send a signal to a thread stephenwalter Programming 2 10-17-2005 01:07 AM
What is hup signal? How to send one to squid? Niceman2005 Linux - Newbie 2 12-17-2004 07:37 PM
Send signal to /dev/dsp marghorp Linux - Hardware 5 05-25-2004 03:17 AM
Linux kernel module programming(Signal and semaphore) eshwar_ind Programming 1 02-16-2004 12:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration