mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Purpose of parameter in sysfs binary read
@ 2009-08-18 14:55 Rick L. Vinyard, Jr.
  2009-08-18 15:14 ` Greg KH
  2009-08-18 15:16 ` Alan Stern
  0 siblings, 2 replies; 18+ messages in thread
From: Rick L. Vinyard, Jr. @ 2009-08-18 14:55 UTC (permalink / raw)
  To: Linux USB, LKML

The read function pointer of the sysfs bin_attribute structure has this
signature:

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
parameter.

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);

Thanks,

Rick


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-12-02 17:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-18 14:55 Purpose of parameter in sysfs binary read Rick L. Vinyard, Jr.
2009-08-18 15:14 ` Greg KH
2009-08-18 15:41   ` Rick L. Vinyard, Jr.
2009-08-18 16:02     ` Greg KH
2009-08-18 17:46       ` Rick L. Vinyard, Jr.
2009-08-19 16:05     ` Alan Cox
2009-08-19 17:41       ` Rick L. Vinyard, Jr.
2009-08-19 18:11         ` Greg KH
2009-08-19 18:26           ` Rick L. Vinyard, Jr.
2009-08-19 18:19         ` Alan Cox
2009-08-19 18:25           ` Rick L. Vinyard, Jr.
2009-08-19 18:34             ` Alan Cox
2009-11-25 19:19               ` Rick L. Vinyard, Jr.
2009-11-25 20:09                 ` Alan Cox
2009-12-02 17:06                   ` Dynamically attaching fbcon to a framebuffer Rick L. Vinyard, Jr.
2009-08-25 11:36         ` Purpose of parameter in sysfs binary read Pavel Machek
2009-08-18 15:16 ` Alan Stern
2009-08-18 15:43   ` Rick L. Vinyard, Jr.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®