LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-14-2009, 11:59 AM   #1
donhuansohn
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
sysfs read access on attribute -> output buffer


hallo,

i created 3 attributes for a device:


static char *ubergabeName = "omg";

...

...
.....


DEVICE_ATTR(name,0644,NULL,NULL);
DEVICE_ATTR(pid,0644,NULL,NULL);
DEVICE_ATTR(pgdir,0644,NULL,NULL);
device_create_file(husoDevice,&dev_attr_name);
device_create_file(husoDevice,&dev_attr_pid);
device_create_file(husoDevice,&dev_attr_pgdir);


now, if in usermode, a reading access on "name" is noticed, the value of ubergabeName (== omg) must be copied to the output puffer.

i think it has something to do with sysfs_ops but i dont know how to write that,

if anyone can help, could you please write a small sourcecode?

thanks
 
  


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
Device attribute in sysfs sticktrick Linux - Kernel 0 07-11-2009 10:04 AM
how to access sysfs files in shared objects akshaynm87 Linux - Newbie 3 05-06-2009 03:44 AM
[bash / readline] Access / output content of yank buffer? FnordPerfect Programming 1 01-19-2007 10:54 AM
lm_sensors Can't access procfs/sysfs file humbletech99 Linux - Hardware 0 08-31-2006 06:40 AM
remove read only attribute in user's directory dsholden Linux - Newbie 5 09-14-2005 05:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 PM.

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