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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ulf Magnusson <ulfalizer@xxxxxxxxx>

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

The termination happens in kernfs_fop_write().

Signed-off-by: Ulf Magnusson <ulfalizer@xxxxxxxxx>
---
 Documentation/filesystems/sysfs.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9494afb..575e997 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -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. 
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux