LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-18-2012, 03:35 AM   #1
eternal_ego
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Question Signal from driver: zeroes in siginfo_t


Hi!

I'm using angstrom linux 2.6.25.5-1.1-pae.

I'm sending some signal from my driver to my user application by calling send_sig_info:

Code:
siginfo_t usig;

usig.si_signo = -SIGUSR2;
usig.si_code = SI_QUEUE;
usig.si_errno = any_integer_variable;
usig.si_value.sival_int = any_other_integer_variable;

send_sig_info(SIGUSR2,&usig,task_ptr);
and in user application:

Code:
static struct sigaction siga;

void mysig_handler(int i, siginfo_t* info, void* f) {
    //code that just checks what I've got in info
}

int main(void) {
//some code before

siga.sa_flags = SA_SIGINFO;
siga.sa_sigaction = mysig_handler;

sigaction(SIGUSR2,&siga,NULL);

//other code after
}
As result, my application receives that signal from driver, but siginfo_t in handler was filled by zeroes! I've tried another si_code in driver (SI_ASYNCIO, SI_USER) - but info remains zero-filled.
Then I had some investigation iside signal.c and I'm sure now that my siginfo_t remains correct in __send_signal function, after copying to new struct sigqueue *q... but then i was lost in kernel code.

Please don't ask me why I need to send signal from driver in kernelspace to application in userspace

I'm just wondering what happens with siginfo_t ? What code should I write to get it correct? I guess problem is located in driver (sending) code, because application can successfully send signal to itself with correct si_value.sival_int.

Thanks in advance!
 
  


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
[SOLVED] Writing zeroes to disk before using it? djspits Linux - Newbie 1 11-18-2010 12:30 PM
IP with padded zeroes in bash frater Linux - Software 7 10-29-2010 08:59 AM
siginfo_t not set on BSD Curtor *BSD 2 11-26-2008 02:25 PM
PCI-BUG #81 [<some zeroes>] Found! What should I do? algogeek Linux - Hardware 3 04-29-2008 02:11 AM
ATI Driver / Monitor Signal Issues eelysium Slackware 0 01-01-2005 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:29 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