Thanks for the information. I have tested with the example from http://linux.die.net/man/3/poll slightly modified (see the attached file). If I test pool on the "/sys/module/systest/sections/.data" file it seems to work fine. But if I try the same test application with my attribute (/sys/kernel/kobject_example/bar) created with the example from linux sources (samples/kobject/kobject_example.c) the result is an event POLLERR. Do you have any idea why ? Need I to add special code for support poll syscall in my driver ? Thanks in advance --- En date de : Mer 7.1.09, Belisko Marek <marek.belisko@xxxxxxxxx> a écrit : > De: Belisko Marek <marek.belisko@xxxxxxxxx> > Objet: Re: sysfs_notify & poll > À: "PAtrick Gerber" <kpa_info@xxxxxxxx> > Date: Mercredi 7 Janvier 2009, 13h59 > Hi, > > On Wed, Jan 7, 2009 at 1:54 PM, PAtrick Gerber > <kpa_info@xxxxxxxx> wrote: > > Ok thanks. Usefull example. But I have another > question: > > > > Need I to use poll or epoll ? I dont really understand > the difference. > epoll is a variant of poll that can be used either as Edge > or Level > Triggered interface and scales well to large numbers of > watched fds. > For beginnig you can use normal poll syscall. > > > > > Thanks in advance for any help ! > > > > On Wed, Jan 7, 2009 at 9:40 AM, PAtrick Gerber > <kpa_info@xxxxxxxx> wrote: > >> Hello, > >> > >> I would like to try to use sysfs_notify() / poll() > mechanism from my > > driver > >> to notify some events to my application. I'm > looking for a tiny > > example > >> showing the use of this mechanism. > >> > >> The driver side with sysfs_notify seems quite > simple but I have absolutely > >> no idea about the application side. > > > > Fo poll method you canfind good description and also > example at: > > http://linux.die.net/man/3/poll > > > >> > >> Thanks in advance > >> > >> Patrick > >> > > > > thanks, > > > > Marek > > > > > > > > > > > > > > > > thanks, > > Marek > > -- > as simple as primitive as possible > ---------------------------------------------- > Marek Beliško - open-nandra > Ruská Nová Ves 219 > 08005 Prešov > Slovakia > http://open-nandra.com
Attachment:
polltest.c
Description: Binary data