Question about /dev/stdin.

Chris Torek chris at mimsy.umd.edu
Thu Nov 9 16:14:49 AEST 1989


In article <6883 at ficc.uu.net> peter at 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 at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list