kill_fasync及fasync_helper用于异步通知中
kill_fasync(&fasync_read, SIGIO, POLL_IN);; //向用户发可读信号,fasync_read可用来区分向谁发
哪个进程调用这个fasync_helper就向谁发
int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp)
{
struct fasync_struct *fa, **fp;
struct fasync_struct *new = NULL;
int result = 0;
if (on) {
new = kmem_cache_alloc(fasync_cache, GFP_KERNEL);
if (!new)
return -ENOMEM;
}
write_lock_irq(&fasync_lock);
for (fp = fapp; (fa = *fp) != NULL; fp =
kill_fasync(&fasync_read, SIGIO, POLL_IN);; //向用户发可读信号,fasync_read可用来区分向谁发
哪个进程调用这个fasync_helper就向谁发
int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp)
{
struct fasync_struct *fa, **fp;
struct fasync_struct *new = NULL;
int result = 0;
if (on) {
new = kmem_cache_alloc(fasync_cache, GFP_KERNEL);
if (!new)
return -ENOMEM;
}
write_lock_irq(&fasync_lock);
for (fp = fapp; (fa = *fp) != NULL; fp =