You're viewing a single thread.
Programmatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
14 0 ReplyI 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; }
19 0 ReplySo it's basically doing nothing and lying about it. 😆
16 0 Reply"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 ReplyCould've at least say thank you...
4 0 ReplyIt's open source. If manners are an important feature to you perhaps look into contributing... :)
2 0 ReplyYeah, that could actually be fun to be honest, lol 😂. But I just know the PR would be rejected, lol 😂.
2 0 Reply
The syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
17 0 ReplyProgrammatically, 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