@0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish • 1 month agoTheoretical physicists: Actually...sh.itjust.worksimagemessage-square32fedilinkarrow-up1350arrow-down12
arrow-up1348arrow-down1imageTheoretical physicists: Actually...sh.itjust.works@0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish • 1 month agomessage-square32fedilink
minus-squareTimeSquirrellinkfedilink15•1 month agoProgrammatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
minus-square@m_f@midwest.sociallinkfedilink20•1 month agoI was also curious, here’s a good answer: https://unix.stackexchange.com/questions/670199/how-is-dev-null-implemented The implementation is: static ssize_t write_null(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { return count; }
minus-squareTimeSquirrellinkfedilink16•1 month agoSo it’s basically doing nothing and lying about it. 😆
minus-squareTaldenNZlinkfedilinkEnglish17•1 month ago“I accepted all of the bytes you gave me. I didn’t do anything with them, but I accept you gave them to me”.
minus-square@0x4E4F@sh.itjust.worksOPlinkfedilinkEnglish4•1 month agoCould’ve at least say thank you…
minus-squareTaldenNZlinkfedilinkEnglish2•30 days agoIt’s open source. If manners are an important feature to you perhaps look into contributing… :)
minus-square@0x4E4F@sh.itjust.worksOPlinkfedilinkEnglish2•29 days agoYeah, that could actually be fun to be honest, lol 😂. But I just know the PR would be rejected, lol 😂.
minus-square@Flipper@feddit.orglinkfedilink17•1 month agoThe syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
minus-squareBoxscapelink6•edit-21 month ago Programmatically, what does the kernel actually do with data sent to /dev/null? I imagine it’s like getting nullified in that olde show ReBoot.
Programmatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
I was also curious, here’s a good answer:
https://unix.stackexchange.com/questions/670199/how-is-dev-null-implemented
The implementation is:
static ssize_t write_null(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { return count; }
So it’s basically doing nothing and lying about it. 😆
“I accepted all of the bytes you gave me. I didn’t do anything with them, but I accept you gave them to me”.
Could’ve at least say thank you…
It’s open source. If manners are an important feature to you perhaps look into contributing… :)
Yeah, that could actually be fun to be honest, lol 😂. But I just know the PR would be rejected, lol 😂.
The syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
I imagine it’s like getting nullified in that olde show ReBoot.