[lkml]   [2009]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectPurpose of parameter in sysfs binary read
The read function pointer of the sysfs bin_attribute structure has this

ssize_t (*read)(struct kobject *kobj, struct bin_attribute *attr,
char *buf, loff_t offset, size_t size);

I've figured out the purpose of all the parameters except the loff_t

Obviously it's an offset of some sort, but what is the meaning of the offset?

If I have binary data in a char* named bindata of size bsize, should it be
copied into buf+offset in something like:
memcpy(buf+offset, bindata, bsize);

Or, is it an offset from both buf and bindata in something like:
memcpy(buf+offset, bindata+offset, bsize-offset);



 \ /
  Last update: 2009-08-18 16:57    [W:0.043 / U:6.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site