LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2013, 10:31 AM   #1
ratbat
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Rep: Reputation: Disabled
Sending data from kernel to user space


What is the simplest way to send data from kernel to user-space?
Is it possible to use the read system call in the user space program?
If yes, please explain how to do so.

Thanks!!
 
Old 04-01-2013, 11:57 AM   #2
PrinceCruise
Member
 
Registered: Aug 2009
Location: /Universe/Earth/India/Pune
Distribution: Slackware64 -Current
Posts: 890

Rep: Reputation: 186Reputation: 186
Hi,
What are you exactly trying to achieve? May be these system calls are what you looking for:-

Quote:
copy_to_user() and copy_from_user()
You'll get a ton load of information on this in web.

Regards.
 
Old 04-02-2013, 01:51 AM   #3
ratbat
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Question

Hi,
Thanks for your help!

I want the user to read data only when something is written by the kernel module. Is it possible to achieve this kind of synchronisation between the user-space program and the kernel module?
 
Old 04-02-2013, 02:33 AM   #4
PrinceCruise
Member
 
Registered: Aug 2009
Location: /Universe/Earth/India/Pune
Distribution: Slackware64 -Current
Posts: 890

Rep: Reputation: 186Reputation: 186
Well, that's possible and that's exactly where I'd use the above mentioned system calls. In the kernel module, in the reader part, use the call copy_to_user() and in the writer, use copy_from_user().

Regards.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How is the data passed between user space and kernel dongbo Programming 3 09-11-2009 04:08 AM
Transfer data from kernel to user space pmil Programming 11 08-01-2009 05:23 AM
how to input data from user space to kernel unikgila Linux - Kernel 3 08-26-2008 10:04 PM
How to share data b/w user space and kernel space nandac Linux - Kernel 1 11-28-2006 10:15 PM
Sending packet from Kernel to User Space kaustubh_pict Linux - Networking 0 03-06-2006 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration