You're viewing a single thread.
TimeSquirrel @kbin.melroy.org Programmatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
15 0 Replym_f @midwest.social 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; }
20 0 ReplyTimeSquirrel @kbin.melroy.org So it's basically doing nothing and lying about it. 😆
16 0 ReplyTaldenNZ @lemmy.nz "I accepted all of the bytes you gave me. I didn't do anything with them, but I accept you gave them to me".
17 0 Reply0x4E4F @sh.itjust.works OP Could've at least say thank you...
4 0 ReplyTaldenNZ @lemmy.nz It's open source. If manners are an important feature to you perhaps look into contributing... :)
2 0 Reply0x4E4F @sh.itjust.works OP Yeah, that could actually be fun to be honest, lol 😂. But I just know the PR would be rejected, lol 😂.
2 0 Reply
Flipper @feddit.org The syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
17 0 ReplyBoxscape @lemmy.sdf.org 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.
6 0 Reply