From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 00:25:00 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95820106564A for ; Fri, 3 Aug 2012 00:25:00 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4858D8FC12 for ; Fri, 3 Aug 2012 00:24:59 +0000 (UTC) Received: from JRE-MBP-2.local (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q730OglD001896 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 2 Aug 2012 17:24:43 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <501B1A45.8010000@freebsd.org> Date: Thu, 02 Aug 2012 17:24:37 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Ed Schouten References: <20120801160323.GN2676@deviant.kiev.zoral.com.ua> <201208012341.25509.hselasky@c2i.net> <5019B1F8.5080802@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: ttydev_cdevsw has no d_purge X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2012 00:25:00 -0000 On 8/2/12 4:23 AM, Ed Schouten wrote: > 2012/8/2 Julian Elischer : >> 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? they would only do that if they were refering to the node BY NAME. Once it's opened, the accesses go via teh internal ( vnode?) objects. if you make the name go away then that wouldn't have any effect on processes that already have the node open. It would be a property of the driver though to decide what happens, but EVENTUALLY yu are going to need to do something about it. > > Whether or not the TTY is a pseudo-terminal or not is completely > irrelevant in my opinion. >