[comp.unix.wizards] /proc, /n/face

henry@utzoo.UUCP (Henry Spencer) (07/10/87)

> V8 /proc preserves the semantics of a normal Unix directory setup *exactly*,
> unless I missed something subtle when I read the code.  My impression is that
> /n/face does likewise.  In both cases the directory hierarchy is actually a
> figment of the kernel's imagination, but it is a consistent figment with the
> same semantics as normal directories.

Several people have asked what this is about, so I suppose I should elaborate
a bit.  This stuff has been presented in papers at Usenix conferences, but
not everybody's familiar with those.

/proc is V8's replacement for the ptrace() system call and related things.
It's a slightly-odd type of file system.  Once mounted, it looks like a
single directory containing a bunch of files with numeric names.  If you
open (say) file "12345", you are looking at the address space of process
number 12345.  Writes into the file are writes into the address space.
There are ioctls for things like stopping and starting the process, sending
it signals, etc.  Access to the files is naturally subject to the standard
Unix file-permission system.  The whole thing is actually a figment of the
kernel's imagination, with the "directory" manufactured on the fly whenever
someone tries to read it, and operations on the "files" turned into the
corresponding operations on the processes.  Apart from being cleaner than
ptrace(), /proc is also faster.

/n/face is a two-part story.  The "/n" part means it's a remote filesystem
mounted over a network.  The thing on the other end is actually a server
process, not a filesystem.  (I erred slightly when I said that both /proc
and /n/face were figments of the *kernel*'s imagination; /n/face is a figment
of the server's imagination.)  The name is because its contents are digitized
faces at various resolutions.  As I recall, they do exist on disk, but the
organization of the disk files differs greatly from the directory tree that
appears to exist under /n/face.

In both cases, these odd filesystems look exactly like real ones, down to
things like "." and ".." entries in the directories.  You can use all the
standard Unix tools to operate on them.

At least one System V implementation of /proc exists inside AT&T, but it
hasn't made it into any released software that I know of.  I believe /n/face
is strictly a V8ism at the moment.
-- 
Mars must wait -- we have un-         Henry Spencer @ U of Toronto Zoology
finished business on the Moon.     {allegra,ihnp4,decvax,pyramid}!utzoo!henry