From owner-freebsd-current@FreeBSD.ORG Thu Aug 2 11:23:26 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 720A0106566B; Thu, 2 Aug 2012 11:23:26 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 280738FC12; Thu, 2 Aug 2012 11:23:26 +0000 (UTC) Received: by obbun3 with SMTP id un3so17640791obb.13 for ; Thu, 02 Aug 2012 04:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=2CSm5sSTEE0L6ZaUe16kyUhVEulxrGsSPMQkVvJECyg=; b=yy7PZcubDqxvo3QfAoGfyG9hD3OFdIwkz02LHYuKlJRxG1FjKLmD0ZAnvRNK5Cwa8h MJ3jDnbLGJakew7Hu771qIO9qDKiU8bbYegA2+oLgh3PVWdFbILGNequaB2eZdNL5eHi QQr7Nk6OE1b2YYERO8x04ePWKN7po9VSQGRmaKQ5o2f0HZd/PTm5t20wPnYe+uPoFNWu DoExJ8+fMgYWQgIyUlJjrvOejDiieBlr7WqdtPJqj+DZ5Y3PL9DGW/k0Xxu0ds+KMFBY sbq2fD1yliWD8FQXa4eX5ztaGnH5MnDLTIh+vK7cAobmUCfF66mFNCKuEiHpckrh69VP qsJA== MIME-Version: 1.0 Received: by 10.60.13.228 with SMTP id k4mr35494139oec.28.1343906605441; Thu, 02 Aug 2012 04:23:25 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.76.153.195 with HTTP; Thu, 2 Aug 2012 04:23:25 -0700 (PDT) In-Reply-To: <5019B1F8.5080802@freebsd.org> References: <20120801160323.GN2676@deviant.kiev.zoral.com.ua> <201208012341.25509.hselasky@c2i.net> <5019B1F8.5080802@freebsd.org> Date: Thu, 2 Aug 2012 13:23:25 +0200 X-Google-Sender-Auth: 5UtS0hd5iHmi9ER9ijEnioBEa2U Message-ID: From: Ed Schouten To: Julian Elischer Content-Type: text/plain; charset=UTF-8 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: Thu, 02 Aug 2012 11:23:26 -0000 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? Whether or not the TTY is a pseudo-terminal or not is completely irrelevant in my opinion. -- Ed Schouten