LinuxQuestions.org
Help answer threads with 0 replies.
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 11-13-2019, 11:27 PM   #1
ssgg2
LQ Newbie
 
Registered: Nov 2019
Posts: 1

Rep: Reputation: Disabled
Unhappy Significance of device_attribute in the show/store function in sysfs.


What is the significance of device_attribute in the show and store function in the sysfs?

Code:
ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf);
I did not get any example where this parameter is being used.
I just want to know that what device_attirbute is doing here.

Can someone please help me to understand this?
 
Old 11-14-2019, 06:46 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I don't know but there is documentation for the sysfs, https://github.com/torvalds/linux/bl...tems/sysfs.txt and it covers the device attribute. I've found a lot of things like that to be difficult reading and that I've had to browse that, go back to the code, and iterate on that until I got the concept.
 
  


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
vSphere / ESXi - Renaming Directory Names in Data-Store and Moving things around in Data-Store devUnix Linux - Virtualization and Cloud 1 04-27-2017 08:13 AM
Missing sysfs() function ... where to find? sieler Linux - Software 3 12-10-2010 12:54 PM
[SOLVED] Threaded function cannot call a function with extern "C" but nonthreaded function can morty346 Programming 16 01-12-2010 05:00 PM
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 11:51 AM
'alsactrl store' doesn't seem to store... endfx Slackware 1 08-20-2004 01:30 AM

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

All times are GMT -5. The time now is 02:36 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