nina on Nostr: oh, you want to get the underlying pid of a pidfd? open `/proc/self/fdinfo/<fd>` ...
oh, you want to get the underlying pid of a pidfd? open `/proc/self/fdinfo/<fd>` (handle all possible error conditions along the way), read it out line by line, find a line that begins with `Pid:`, strip its whitespace (handle all possible error conditions along the way), and parse the number contained in the leftover string (handle all possible error conditions along the way)
-- statements dreamed up by the utterly Deranged
Published at
2024-09-24 17:02:00Event JSON
{
"id": "aa749e45551814e8207c005a8887b45a6d199c1e6d18c801aabf19a7823dd410",
"pubkey": "f3366b17f5ef004bcd8976383655d362fec5e9f8eabacb55fa5835de095066f7",
"created_at": 1727197320,
"kind": 1,
"tags": [
[
"e",
"c1600c9052e3ac1bdcf06a61198cf57fa67a8706c9a95770afab13b8f104962d",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://blahaj.social/users/q66/statuses/113193603603015560",
"activitypub"
]
],
"content": "oh, you want to get the underlying pid of a pidfd? open `/proc/self/fdinfo/\u003cfd\u003e` (handle all possible error conditions along the way), read it out line by line, find a line that begins with `Pid:`, strip its whitespace (handle all possible error conditions along the way), and parse the number contained in the leftover string (handle all possible error conditions along the way)\n\n-- statements dreamed up by the utterly Deranged",
"sig": "b80d1e217c21e18d226c435b76be1fcd3e4bb6d94c4122c4cb36e0e3186d1b63da60e22e9af37059d827d6a9a117423d28b9d012e8fc9feb680abc5d9984c905"
}