Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!ucbvax!ICAEN.UIOWA.EDU!dbfunk
From: dbfunk@ICAEN.UIOWA.EDU (David B. Funk)
Newsgroups: comp.sys.apollo
Subject: Re: magical mystery /dev/null
Message-ID: <8811290639.AA22872@umaxc.weeg.uiowa.edu>
Date: 29 Nov 88 06:05:40 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: Iowa Computer Aided Engineering Network, University of Iowa
Lines: 36

WRT how to recreate "/dev/null".

"/dev/null" is a file that is one of Apollo's special types.
It is a file, (of type "null") that when touched, invokes the
type manager that provides the appropriate "null device" behaivor.
The name or location of the file are of no consequence, just that
it be of type "null". The type UID of an object can be seen with
either the "/com/obty" utility or the "-tu" option on "/com/ld".

You can create a new one from scratch with the "ios_$create"
system call in a program, use the value "nulldev_$uid" for the
third parameter. You can take a copy from the system device
template directory "/sys/sysdev". If you want to copy the
file "/sys/sysdev/null" be sure to use "/com/cpf", NOT
"/bin/cp". UNIX doesn't understand an object oriented file
system so it will ignore the type of the file and just
try to copy the contents of it. This will just give you
an empty ASCII file with no special typing. Aegis tools
understand the importantce of the type of the files and
will copy the containing type information, producing the
desired results. IE. UNIX deals with file contents, Aegis
deals with the file containers & contents.

To make a long story short, issue the command:

  /com/cpf /sys/sysdev/null /dev/null

ON THE MACHINE that you wish to replace a destroyed /dev/null.

PS: you can use this trick to make "black-hole" files anywhere
that you want. They can be usefull for soaking up unwanted
program output, log files, etc, without having to messing around
with I/O redirection.

Dave Funk
University of Iowa