home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 10927 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.3 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!edcastle!aiai!richard
  2. From: richard@aiai.ed.ac.uk (Richard Tobin)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Logical console
  5. Message-ID: <8091@skye.ed.ac.uk>
  6. Date: 5 Jan 93 18:35:14 GMT
  7. Sender: news@aiai.ed.ac.uk
  8. Organization: HCRC, University of Edinburgh
  9. Lines: 32
  10.  
  11. When I log in, the pc screen (/dev/vga) is the console.  If I do
  12.  
  13.   echo hi >/dev/vga
  14.  
  15. this hangs - I never get a shell prompt back.
  16.  
  17. If before the echo, I do
  18.  
  19.   sleep 9999 >/dev/vga &
  20.  
  21. then the echo doesn't hang.
  22.  
  23. In the first case, when echo exits, the kernel calls pcclose(); in the
  24. second case it doesn't.  I conjecture that this is the cause of the
  25. problem.
  26.  
  27. pcclose() is called because no process except echo has /dev/vga open
  28. directly, though the shell has it open indirectly through the console
  29. device.  It seems to me that opening a device indirectly (as the
  30. console) should increment its reference count so that this doesn't
  31. happen.  Alternatively the function (vcount() I think) which takes
  32. account of aliasing of devices through multiple inodes with the same
  33. major/minor device number could take account of aliasing through the
  34. console.
  35.  
  36. Have I understood this correctly?
  37.  
  38. -- Richard
  39. -- 
  40. Richard Tobin,
  41. Human Communication Research Centre,                       R.Tobin@ed.ac.uk
  42. Edinburgh University.
  43.