SYSFS_READ_FILE

Section: ()
Updated: 06 October 2005
Index Return to Main Contents

 

NAME

sysfs_read_file - read an attribute.  

SYNOPSIS

"SYNOPSIS"

ssize_t sysfs_read_file (struct file * file, char __user * buf, size_t count, loff_t * ppos);  

ARGUMENTS

file
file pointer.
buf
buffer to fill.
count
number of bytes to read.
ppos
starting offset in file.
 

DESCRIPTION

Userspace wants to read an attribute file. The attribute descriptor is in the file's ->d_fsdata. The target object is in the directory's ->d_fsdata.

We call fill_read_buffer to allocate and fill the buffer from the object's show method exactly once (if the read is happening from the beginning of the file). That should fill the entire buffer with all the data the object has to offer for that attribute. We then call flush_read_buffer to copy the buffer to userspace in the increments specified.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION

This document was created by man2html, using the manual pages.
Time: 06:21:14 GMT, October 06, 2005