0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish · 1 day agoTheoretical physicists: Actually...sh.itjust.worksimagemessage-square30fedilinkarrow-up1312arrow-down12
arrow-up1310arrow-down1imageTheoretical physicists: Actually...sh.itjust.works0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish · 1 day agomessage-square30fedilink
minus-squareTimeSquirrel@kbin.melroy.orglinkfedilinkarrow-up13·1 day agoProgrammatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
minus-squarem_f@midwest.sociallinkfedilinkarrow-up18·1 day 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-squareTimeSquirrel@kbin.melroy.orglinkfedilinkarrow-up14·1 day agoSo it’s basically doing nothing and lying about it. 😆
minus-squareTaldenNZ@lemmy.nzlinkfedilinkEnglisharrow-up13·1 day 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-square0x4E4F@sh.itjust.worksOPlinkfedilinkEnglisharrow-up4·1 day agoCould’ve at least say thank you…
minus-squareTaldenNZ@lemmy.nzlinkfedilinkEnglisharrow-up2·6 hours agoIt’s open source. If manners are an important feature to you perhaps look into contributing… :)
minus-squareFlipper@feddit.orglinkfedilinkarrow-up16·1 day agoThe syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
minus-squareBoxscape@lemmy.sdf.orglinkfedilinkarrow-up5·edit-21 day 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… :)
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.