argv[-1] on Nostr: Huh. I once was told that #Linux sysfs files have some special quirks, most notably ...
Huh.
I once was told that #Linux sysfs files have some special quirks, most notably that you have to read() them all in one go; the kernel won't buffer their contents if you try to partially read() them.
Apparently that got fixed at some point, because read()ing one byte at a time seems to work fine:
$ dd if=/sys/devices/system/cpu/modalias of=/dev/stdout bs=1
cpu:type:x86,ven… [trimmed for brevity]
Works on 5.4.17 and 7.2.12.
Published at
2026-11-30 20:40:43 UTCEvent JSON
{
"id": "a9d697657d9ca45ede476bef24d916984da79f1339ea7c4d30e9899869b036db",
"pubkey": "e97cafa82a7dd144bb2ec1089abea1190be419346e906bf69f0bc243f01586fc",
"created_at": 1796071243,
"kind": 1,
"tags": [
[
"t",
"linux"
],
[
"proxy",
"https://mastodon.sdf.org/users/argv_minus_one/statuses/117707325011627096",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Huh.\n\nI once was told that #Linux sysfs files have some special quirks, most notably that you have to read() them all in one go; the kernel won't buffer their contents if you try to partially read() them.\n\nApparently that got fixed at some point, because read()ing one byte at a time seems to work fine:\n\n$ dd if=/sys/devices/system/cpu/modalias of=/dev/stdout bs=1\ncpu:type:x86,ven… [trimmed for brevity]\n\nWorks on 5.4.17 and 7.2.12.",
"sig": "f9b6101b385e1fd2962f9840b2196ef3c95e895a9084b66bf03b7c6ee2507ee4385c0fb1b3d157b38fbbf79de4be891bf99c6aa343c9fb737acc6a68855f943f"
}