Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 +SENDMAIL+2.11; site dcl-cs.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!gatech!seismo!mcvax!ukc!dcl-cs!stephen From: stephen@dcl-cs.UUCP (Stephen J. Muir) Newsgroups: net.unix-wizards Subject: Re: /dev/null Message-ID: <808@dcl-cs.UUCP> Date: Fri, 22-Nov-85 18:12:48 EST Article-I.D.: dcl-cs.808 Posted: Fri Nov 22 18:12:48 1985 Date-Received: Mon, 25-Nov-85 06:51:04 EST References: <593@ttrdc.UUCP> Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir) Organization: Department of Computing at Lancaster University. Lines: 26 >Seeing that /dev/mem and /dev/kmem are "windows" into the physical memory space >of the computer, I wonder if /dev/null is implemented as a "window" into a >nonexistent section of physical memory, or what? cp /etc/motd /dev/null panic: segmentation violation What happens is that all writes map onto the "write" system call (write(2)). The code (off the top of my head) goes like: write (filedes, buffer, nbytes) char *buffer { if (major_minor (filedes) == that_of ("/dev/null")) return (nbytes); else go_do_the_REAL_write (filedes, buffer, nbytes); } So the "write" system call just returns success and does nothing! -- UUCP: ...!seismo!mcvax!ukc!dcl-cs!stephen DARPA: stephen%comp.lancs.ac.uk@ucl-cs | Post: University of Lancaster, JANET: stephen@uk.ac.lancs.comp | Department of Computing, Phone: +44 524 65201 Ext. 4599 | Bailrigg, Lancaster, UK. Project:Alvey ECLIPSE Distribution | LA1 4YR