home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / dev.fd / README / text0000.txt < prev   
Encoding:
Text File  |  1987-08-06  |  1.1 KB  |  40 lines

  1. I'm re-posting this due to popular demand:
  2.  
  3. This is a pseudo-device driver which implements a
  4. series of devices: /dev/fd0 - /dev/fd19 which are
  5. surreptitiously equivalenced to whatever file (if
  6. any) is associated with the corresponding file
  7. descriptor in the process which is attempting to
  8. open that file. In other words: opening the file
  9. /dev/fd<n> is almost the same as doing the system
  10. call: dup(n). It's different in that if the file
  11. is a device, the driver's open routine is called.
  12. If the corresponding file descriptor is a pipe
  13. (socket) a dup() sys call is faked.
  14.  
  15. This can be used to force programs to read from
  16. their standard input, or write to their standard
  17. output, even if they haven't been designed to do
  18. so.  For instance:
  19.  
  20.     ln -s /dev/fd0 xx.c
  21.     cc xx.c
  22.     { Type a C program here. }
  23.     ^D
  24.     a.out
  25.  
  26. Or, to see if a certain source file compiled into a
  27. particular object file:
  28.  
  29.     cc source.c -o /dev/fd1 | cmp - objectfile
  30.  
  31. Be sure to make these mods in your conf directory.
  32.  
  33. In the config file:
  34.     pseudo-device    fd
  35.  
  36. In the ``files'' file:
  37.     sys/dev_fd.c        optional fd
  38.  
  39. <**************************************************************>
  40.