public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kill_fasync usage
@ 2003-03-04 20:08 no_spam
  0 siblings, 0 replies; 2+ messages in thread
From: no_spam @ 2003-03-04 20:08 UTC (permalink / raw)
  To: linux-kernel


Dear list, 

quick advice please,

I wnat to use kill_fasync(struct fasync_struct *PTR,...) to notify userland of 
events.  Can I just call kill_fasync regardless of the state of PTR or does 
PTR actually have to point to something valid.  

In my code PTR=NULL initially and may or may not be set or unset during use. I 
would like to know if I can call kill_fasync without testing what is in PTR.  
If I have to test what would PTR be if there isn't anything in the queue?
If I can't test PTR how can I find out from the arguments to my fasync method 
if I am adding (or removing) processes from the list?

Thanks SA 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kill_fasync usage
@ 2003-03-04 21:02 Manfred Spraul
  0 siblings, 0 replies; 2+ messages in thread
From: Manfred Spraul @ 2003-03-04 21:02 UTC (permalink / raw)
  To: no_spam; +Cc: linux-kernel

SA wrote:

>I wnat to use kill_fasync(struct fasync_struct *PTR,...) to notify userland of 
>events.  Can I just call kill_fasync regardless of the state of PTR or does 
>PTR actually have to point to something valid.  
>  
>
kill_fasync receives the _address_ of the variable that contains the 
list of processes that need notifications. It must not be NULL. (I 
assume you look at 2.4 or 2.5 - 2.2 had a different interface)

Check linux/drivers/char/busmouse.c for an example, the interface is 
simple: call fasync_helper to register and kill_fasync for the actual 
notification.

--
    Manfred


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-04 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-04 21:02 kill_fasync usage Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2003-03-04 20:08 no_spam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox