Skip to contentSkip to conversation

sysfs.txt: mention that store method buffers are null-terminated

PATCH Applied [email protected] 2 participants 2 messages Sep 7, 2015 – Sep 12, 2015 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysfs.txt: mention that store method buffers are null-terminated

From: Ulf Magnusson <[email protected]>

Without knowing this, the use of sysfs_streq() becomes puzzling.

The termination happens in kernfs_fop_write().

---
 Documentation/filesystems/sysfs.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/filesystems/sysfs.txt +3 -0
index 9494afb..575e997 100644
@@ -198,6 +198,9 @@ implementations:
   entire file, modify the values it wishes to change, then write the
   entire buffer back. 
 
+  A terminating null is added after the data on stores. This makes
+  functions like sysfs_streq() safe to use.
+
   Attribute method implementations should operate on an identical
   buffer when reading and writing values. 
 
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 3 lines · On Mon, 7 Sep 2015 19:06:14 +0200 [email protected] wrote:

Without knowing this, the use of sysfs_streq() becomes puzzling.

The termination happens in kernfs_fop_write().

Applied to the docs tree. I moved it up a paragraph, though, since it better fits the flow of the document there.

Thanks,

jon