I'm not sure if copy_to_user will work for what you want.  I think
it might be possible to use, but I don't believe it would be the cleanest
approach.  In order to use copy_to_user you will need to know what memory
location to copy data to so the user process can read it, plus you'll need
to know when to signal your user process to read the data.  I guess these
problems could be solved, but I think you might prefer to use something like
a netlink socket.  It's already been implemented in the kernel and there's a
lot of sample code already using it from various router applications.  You
should look at "zebra" it should give you a good start, along with some
searches in google for "netlink sockets".  

        You could also look into using procfs, there's a good simple example
of how to use it included with the kernel documentation.   


        Best of luck,
        John Matthews

P.S.  If you get really stuck with the netlink socket I could send you some
of my source code I wrote when learning how to use it.




-----Original Message-----
From: d deepak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 10:02 AM
To: [EMAIL PROTECTED]
Subject: Re: Sending info to user process from kernel


Hi
I am working on Bluetooth, my Bt stack is a kernel. I
want to send events to a user app. this should go as
an asynchronous event, ie, application will be doing
something else and still it should receive my event.

deepak

--- Jonathan Bartlett <[EMAIL PROTECTED]> wrote:
> What specifically are you trying to do?
> 
> The easiest way to do this is probably copy_to_user,
> but it would be more
> useful if you said what you were trying to do.
> 
> Jon
> 
> On Tue, 2 Jul 2002, d deepak wrote:
> 
> > Hi all,
> >
> > I am new to Linux, my requirement is to send some
> data
> > from kernel module to a user program
> asynchronouslly.
> > Colud any of u please tell me which is the easiest
> way
> > to do this. It would be great if u can send some
> > sample code.
> >
> > thanks in advance
> >
> > deepak
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Sign up for SBC Yahoo! Dial - First Month Free
> > http://sbc.yahoo.com
> >
> >
> >
> > _______________________________________________
> > Redhat-devel-list mailing list
> > [EMAIL PROTECTED]
> >
>
https://listman.redhat.com/mailman/listinfo/redhat-devel-list
> >
> 
> 
> 
> _______________________________________________
> Redhat-devel-list mailing list
> [EMAIL PROTECTED]
>
https://listman.redhat.com/mailman/listinfo/redhat-devel-list


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to