@[email protected] to linuxmemesEnglish • 18 hours agoTheoretical physicists: Actually...sh.itjust.worksimagemessage-square29fedilinkarrow-up1260arrow-down12
arrow-up1258arrow-down1imageTheoretical physicists: Actually...sh.itjust.works@[email protected] to linuxmemesEnglish • 18 hours agomessage-square29fedilink
minus-squareTimeSquirrellinkfedilink12•17 hours 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@[email protected]linkfedilink16•15 hours 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-squareTimeSquirrellinkfedilink13•15 hours agoSo it’s basically doing nothing and lying about it. 😆
minus-squareTaldenNZlinkfedilinkEnglish9•14 hours 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@[email protected]linkfedilink15•17 hours agoThe syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
minus-squareBoxscapelinkfedilink5•edit-217 hours 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…
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.