Timeline for How is /dev/null implemented?
Current License: CC BY-SA 4.0
        8 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 22, 2023 at 1:57 | vote | accept | Ярослав Рахматуллин | ||
| Sep 22, 2021 at 21:23 | answer | added | Stephen Kitt | timeline score: 9 | |
| Sep 22, 2021 at 21:07 | comment | added | jesse_b | 
        
            
    Yeah I mean cat /dev/urandom is pretty cpu intensive in itself so a do nothing process for every line added to it probably wouldn't add much.
        
     | 
|
| Sep 22, 2021 at 21:01 | comment | added | Jim L. | 
        
            
    As for specifically how it's implemented, recall that Linux is, after all, open source.  This link is the best I can find quickly, but a more in-depth look can be had from the FreeBSD kernel's null device at https://www.leidinger.net/FreeBSD/dox/dev_null/html/da/dea/null_8c_source.html.  Basically, all that has to happen when writing to /dev/null is ... nothing.  The device driver does nothing, and returns a successful result code.
        
     | 
|
| Sep 22, 2021 at 20:52 | history | edited | Ярослав Рахматуллин | CC BY-SA 4.0 | 
        
            
             
                
                    added 303 characters in body 
                
             
        
     | 
| Sep 22, 2021 at 20:49 | comment | added | jesse_b | Not very verbose but see null(4) | |
| Sep 22, 2021 at 20:49 | comment | added | Peregrino69 | Here's a recent thread with pretty much the same exact question :-) | |
| Sep 22, 2021 at 20:44 | history | asked | Ярослав Рахматуллин | CC BY-SA 4.0 |