Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-19-2012, 09:15 PM   #1
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 04:49 AM.
Old 05-22-2012, 09:27 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,025

Rep: Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806
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, 07:46 AM   #3
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 "
//this sentence is above !!!
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 07:48 AM.


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

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

All times are GMT -5. The time now is 01:22 AM.

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