[comp.unix.wizards] Question about /dev/stdin.

chris@mimsy.umd.edu (Chris Torek) (11/09/89)

In article <6883@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>How does !open("/dev/stdin", O_RDONLY)! work?

The correct answer is:
>	3. It dups fd0.

Fred Blonder (who wrote the original version of the 4.4BSD /dev/fd driver)
had a second version of the driver (to be distinguished from the third
version, which is different from the fourth version, which is the one,
or the direct predecessor of the one, which will be in 4.4BSD ... or
something like that :-) ) which re-opened the underlying inode, so that
you got a different seek pointer.  Unfortunately, it had to work one
way for inodes, and another for sockets; and the V8 /dev/fd driver did
dup(), so we simplified it.  You now get only a dup().
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris