*BSD News Article 9569


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6012 ; Sun, 03 Jan 93 04:55:29 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!pipex!bnr.co.uk!uknet!edcastle!aiai!richard
From: richard@aiai.ed.ac.uk (Richard Tobin)
Newsgroups: comp.unix.bsd
Subject: Logical console
Message-ID: <8091@skye.ed.ac.uk>
Date: 5 Jan 93 18:35:14 GMT
Sender: news@aiai.ed.ac.uk
Organization: HCRC, University of Edinburgh
Lines: 32

When I log in, the pc screen (/dev/vga) is the console.  If I do

  echo hi >/dev/vga

this hangs - I never get a shell prompt back.

If before the echo, I do

  sleep 9999 >/dev/vga &

then the echo doesn't hang.

In the first case, when echo exits, the kernel calls pcclose(); in the
second case it doesn't.  I conjecture that this is the cause of the
problem.

pcclose() is called because no process except echo has /dev/vga open
directly, though the shell has it open indirectly through the console
device.  It seems to me that opening a device indirectly (as the
console) should increment its reference count so that this doesn't
happen.  Alternatively the function (vcount() I think) which takes
account of aliasing of devices through multiple inodes with the same
major/minor device number could take account of aliasing through the
console.

Have I understood this correctly?

-- Richard
-- 
Richard Tobin,
Human Communication Research Centre,                       R.Tobin@ed.ac.uk
Edinburgh University.