Re: userspace notification from module

From: BartÅomiej ZimoÅ
Date: Sat Jan 02 2010 - 08:29:40 EST


Dnia 2 stycznia 2010 13:36 Daniel Borkmann <llug.dan@xxxxxxxxxxxxxx> napisaÅ(a):

> Hi BartÅomiej,
>
> BartÅomiej ZimoÅ wrote:
> > Use inotify from userspace could be interesting for such data,
> > but looks like sysfs/procfs doesn't send signal about data changed in file or maybe i'm wrong?
> >
> > If sysfs/procfs is wrong for that so must create device file, but here secound problem
> > how to notify that file/buffer has new data?
>
> Actually, the file content of a procfs file is volatile and generated on
> the fly, just have a look at some device drivers or at the API.
>

As I fought. Reading now sources of some char drivers.

> Did you have a look at the netlink protocol for communication from
> kernel to userspace?
>

Ok i will :)

I will explain more what i'm going to do.
The idea is simple. Kernel before suspend/resume sends notification to
registered kernel objects. So i have written small module to register
there and want now pass these data to /dev/file. It is 1byte so not a big deal.

I'm searching now for notification about new byte in buffer, as it is almost
clear for async: http://www.xml.com/ldd/chapter/book/ch05.html#t4
but for sync still haven't find.

It could be interesting for NetworkManager to hook on such event.

Looks like my post arrives 2nd time in lkml.

Thx for reply.

Best Regards.
BartÅomiej ZimoÅ
PLD Linux, Kadu Team

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/