data_read(9)
π data_read(9) β Kernel API Manual, but make it a group chat π
okay so bestie, welcome to data_read β the read function for the "data" sysfs attribute. yes, that one. she's a sysfs read callback and she's literally the main character of this page. come on, let's get into it β¨
πΈ SYNOPSIS πΈ
like, the whole vibe in one block:
ssize_t data_read (struct file *file , struct kobject *kobj , const
struct bin_attribute *attr , char *buffer , loff_t off , size_t size );
bestie she returns an ssize_t. noted. moving on π
π ARGUMENTS π
six params, six little besties, let's meet them:
fileβ the open file pointer π«Άkobjβ the kobject of thesclp_sd_fileobject, iykykattrβ the data attribute (she's a data attribute, that's the whole thing)bufferβ the target buffer, aka where the good stuff goes πoffβ the requested file offset, like where in the file we're peeking πsizeβ the requested number of bytes, the how-much-are-we-reading number
π¦ DESCRIPTION π¦
so what she does: she takes the requested portion of the Store Data entity contents and stores it into the specified buffer. that's it. that's the function. she ate π
and the return value? on success she hands you back the number of bytes she stored, or 0 on EOF. yes queen, 0 means EOF, don't @ me π
ngl, this is the part where you actually remember the return semantics: bytes stored on success, 0 on EOF. write it on your hand if you have to.
β¨ SEE ALSO β¨
the whole friend group, no cap β they all live in the kernel file ./drivers/s390/char/sclp_sd.c:
struct sclp_sd_data(9)struct sclp_sd_listener(9)struct sclp_sd_file(9)sclp_sd_listener_add(9)sclp_sd_listener_remove(9)sclp_sd_listener_init(9)sclp_sd_receiver(9)sclp_sd_sync(9)sclp_sd_store_data(9)sclp_sd_data_reset(9)sclp_sd_file_release(9)sclp_sd_file_update(9)sclp_sd_file_update_async(9)reload_store(9)sclp_sd_file_create(9)sclp_sd_init(9)
go read them all, they're iconic, periodt π
π the cute little sign-off π
this page lives in ./drivers/s390/char, and it's dated October 2026. so she's from the future AND from the s390 char drivers folder. obsessed. bye bestie, go read some sysfs attributes π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms