LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 05-19-2012, 08:15 PM   #1
xiewanchen
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Rep: Reputation: Disabled
Question dirver programming


when I call the funtion of kill_fasync() in the driver program, Why does this sentence "kill_fasync: bad magic number in fasync_struct!" was printed on the screen? Please explain it in details !

Last edited by xiewanchen; 05-20-2012 at 03:49 AM.
 
Old 05-22-2012, 08:27 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 1,143

Rep: Reputation: 258Reputation: 258Reputation: 258
That message is printed because there is a mistake in your code. Since you don't show any of your code it's hard to say more, but I've seen many problems caused by not checking return values from system calls.
 
Old 05-24-2012, 06:46 AM   #3
xiewanchen
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have not shown any code because I don't know which section of the code is helpful for you to solve this problem. I can find this sentence which was printed on the screen in the kernel code.
static void kill_fasync_rcu(struct fasync_struct *fa, int sig, int band)
{
while (fa) {
struct fown_struct *fown;
unsigned long flags;

if (fa->magic != FASYNC_MAGIC) {
printk(KERN_ERR "kill_fasync: bad magic number in "
"fasync_struct!\n");
//this sentence is above !!!
return;
}
spin_lock_irqsave(&fa->fa_lock, flags);
if (fa->fa_file) {
fown = &fa->fa_file->f_owner;
/* Don't send SIGURG to processes which have not set a
queued signum: SIGURG has its own default signalling
mechanism. */
if (!(sig == SIGURG && fown->signum == 0))
send_sigio(fown, fa->fa_fd, band);
}
spin_unlock_irqrestore(&fa->fa_lock, flags);
fa = rcu_dereference(fa->fa_next);
}
}

Last edited by xiewanchen; 05-24-2012 at 06:48 AM.
 
  


Reply

Tags
driver, programing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wpa_supplicant ipw2200 unsupported dirver cfabio Linux - Wireless Networking 4 03-08-2011 04:31 AM
Have a trouble with compiling simple dirver. sulacco Programming 26 01-16-2009 09:48 AM
Need to keep re-installing NVIDIA Dirver ? bogzab Slackware 9 06-12-2007 09:44 AM
problem with suse 9.3 nvidia dirver dred Suse/Novell 11 07-12-2005 08:19 AM
video dirver for quake3 (demo) Smerk Linux - Games 10 12-19-2003 01:56 PM


All times are GMT -5. The time now is 05:58 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration