From owner-cvs-src@FreeBSD.ORG Mon May 5 14:10:02 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 803131065678; Mon, 5 May 2008 14:10:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1DCD08FC33; Mon, 5 May 2008 14:10:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m45E79jr046752; Mon, 5 May 2008 08:07:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 05 May 2008 08:08:23 -0600 (MDT) Message-Id: <20080505.080823.2086232061.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200805050949.27063.jhb@freebsd.org> References: <5978.1209974842@critter.freebsd.dk> <200805050949.27063.jhb@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, kmacy@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, phk@phk.freebsd.dk, cperciva@FreeBSD.org Subject: Re: cvs commit: src/etc/etc.mips ttys X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2008 14:10:02 -0000 In message: <200805050949.27063.jhb@freebsd.org> John Baldwin writes: : On Monday 05 May 2008 04:07:22 am Poul-Henning Kamp wrote: : > In message <481EB19B.3000201@freebsd.org>, Colin Percival writes: : > >Poul-Henning Kamp wrote: : > >> In message <200805050535.m455ZmI1030493@repoman.freebsd.org>, Warner : > >> Losh write : > >> : > >> s: : > >>> Added files: : > >>> etc/etc.mips ttys : > >>> Log: : > >>> Mips ttys file. Copied from i386 version with removal of the vga : > >>> entries. : > >> : > >> We should really replace this file with a script that generates it : > >> from a set of sensible parameters at build-time. : > > : > >Yes please -- kmacy might have worked around this, but at one point this : > >was the only non-kernel file which needed to be different for Xen builds. : > : > And for anyone looking at this, there is also a task to eliminate the : > pty devices in this file, the reason why they are there has to do with : > the introduction of the really weird notion of "remote logins" back in : > the early 1980'ies, we really could do better. : : Err, I thought it was because utmp still uses the line index in /etc/ttys so : ptys have to be listed in /etc/ttys to get an index. I haven't looked at : utmpx, but it might be nice if we had a utmp format that 1) didn't limit : usernames to 16 chars, and 2) stored the name of the tty rather than a dev_t. : 2) is what I think has broken 'w -M /var/crash/vmcore.X' since 5.x. /var/run/utmp stores the name. However, it does appear to use the index in /etc/ttys to write the record into /var/run/utmp. typical entries look like: 000002c0 74 74 79 70 30 00 00 00 69 6d 70 00 00 00 00 00 |ttyp0...imp.....| 000002d0 00 00 00 00 00 00 00 00 3a 30 2e 30 00 00 00 00 |........:0.0....| 000002e0 00 00 00 00 00 00 00 00 28 ec 14 48 |........(..H Which matches the structures fairly well: struct utmp { char ut_line[UT_LINESIZE]; char ut_name[UT_NAMESIZE]; char ut_host[UT_HOSTSIZE]; int32_t ut_time; }; Unfortunately, the #defines for the above are somewhat meager: #define UT_NAMESIZE 16 /* see MAXLOGNAME in */ #define UT_LINESIZE 8 #define UT_HOSTSIZE 16 Warner