Re: Doubt on show() function of sysfs attribute

2021-01-27 Thread Mohana Datta Yelugoti
> > See the thousands of examples in the kernel of this if you need proof :) > True. I was actually confused because many kernel examples use sysfs_emit() and here in sysfs_emit(), the buffer is not completely filled. But, i got it now. I will experiment more and will see if i can send a

Re: Doubt on show() function of sysfs attribute

2021-01-27 Thread Lukas Bulwahn
On Wed, Jan 27, 2021 at 9:10 AM Greg KH wrote: > > On Tue, Jan 26, 2021 at 11:07:24PM +0530, Mohana Datta Yelugoti wrote: > > Hello everyone, > > > > I am going through Documentation/filesystems/sysfs.rst. > > > > It says that sysfs allocates a buffer of size PAGE_SIZE and > > passes it to the

Re: Doubt on show() function of sysfs attribute

2021-01-27 Thread Greg KH
On Tue, Jan 26, 2021 at 11:07:24PM +0530, Mohana Datta Yelugoti wrote: > Hello everyone, > > I am going through Documentation/filesystems/sysfs.rst. > > It says that sysfs allocates a buffer of size PAGE_SIZE and > passes it to the show/store functions of the attribute. On > read(), the show()

Re: Doubt on show() function of sysfs attribute

2021-01-26 Thread Valdis Klētnieks
On Tue, 26 Jan 2021 23:07:24 +0530, Mohana Datta Yelugoti said: > Hello everyone, > > I am going through Documentation/filesystems/sysfs.rst. > > It says that sysfs allocates a buffer of size PAGE_SIZE and > passes it to the show/store functions of the attribute. On > read(), the show() method

Doubt on show() function of sysfs attribute

2021-01-26 Thread Mohana Datta Yelugoti
Hello everyone, I am going through Documentation/filesystems/sysfs.rst. It says that sysfs allocates a buffer of size PAGE_SIZE and passes it to the show/store functions of the attribute. On read(), the show() method should fill the entire buffer[0]. The document also says that sysfs_emit() and