Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!amdahl!dlb!megatest!berryman From: berryman@megatest.UUCP Newsgroups: comp.unix.questions Subject: Re: /dev/null: The final frontier Message-ID: <1519@megatest.UUCP> Date: Thu, 21-May-87 18:47:36 EDT Article-I.D.: megatest.1519 Posted: Thu May 21 18:47:36 1987 Date-Received: Sat, 23-May-87 08:15:55 EDT References: <100@upas.UUCP> Distribution: world Organization: Megatest Corporation, San Jose, Ca Lines: 45 in article <100@upas.UUCP>, rcw@upas.UUCP (Robert White) says: > > > this line == can of raid > > Some of these questions may be trivial. I've lost sleep over them: > > Where do the bytes go when moved or copied to /dev/null? > Does the machine dissipate the data as heat? > How does a null device driver work? > > Robert White > Graphics Information, Inc. > UUCP: seismo!hao!scicom!qetzal!rcw Here's the honest to god truth from someone who spent years optimizing the driver for /dev/null: 1. The bytes are sorted by age and are kept around for use by other processes. Integers are stored in network order and one must be careful to use ntohs and ntohl before using. 2. The machine stores the data - no heat is released. (see 1). 3. Writes to /dev/null do not occur immediatly but are buffered in a special buffer cache maintained specifically for /dev/null. Writes to /dev/null are processed in order of decreasing pid*uid/log(averun). Common program errors may occur because of this ordering scheme. Reads from /dev/null are non-blocking and asynchronous so the programmer may never be sure when the read is completed. Hope this helps you sleep better. Ed Blackmond Lieutenant Kernel Hacker Megatest Corporation 880 Fox Lane San Jose, CA 95035 {sun, amd, fortune, dlb}!megatest!eb Disclaimer -- The above opinions are those of the author and should be considered the gospel truth.