Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2012 13:23:25 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Julian Elischer <julian@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: ttydev_cdevsw has no d_purge
Message-ID:  <CAJOYFBBbskRbXjKZdv-JgHi4vJgW0S0N2DGvZgm5_oDWcY65ig@mail.gmail.com>
In-Reply-To: <5019B1F8.5080802@freebsd.org>
References:  <20120801160323.GN2676@deviant.kiev.zoral.com.ua> <CAJOYFBDsK8cZYc28sKcC0qcZrpy2=A3QAHvP5fEj9gn=Acwciw@mail.gmail.com> <201208012341.25509.hselasky@c2i.net> <5019B1F8.5080802@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2012/8/2 Julian Elischer <julian@freebsd.org>:
> I think that the /dev/entries can (and SHOULD) go away when the hardware
> goes away and even be re-used.

But here's the point. TTYs are used in a different way than other
device nodes. Regular device nodes are simply opened by a set of
independent process (e.g. dd if=/dev/da0, a music player opening
/dev/dsp, etc). TTYs are used by a set of processes that share a weak
relationship, namely all belonging to the same login session.

Things *really* break if you were to forcefully remove a TTY device
node and replace it by another TTY. Even for physical devices it would
be really bad to do. Consider a system that has two USB to serial
converters that are used for interactive login sessions. One is
plugged in, the other one isn't. If you unplug one device and plug in
the other, you never want the processes from the one login session to
start interacting with the other device.

Also, applications relying on the user accounting database (utmpx)
will start to behave non-deterministically then. Do we really want
biff and wall to write stuff to random TTYs?

Whether or not the TTY is a pseudo-terminal or not is completely
irrelevant in my opinion.

-- 
Ed Schouten <ed@80386.nl>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJOYFBBbskRbXjKZdv-JgHi4vJgW0S0N2DGvZgm5_oDWcY65ig>