NetBSD Problem Report #451
From gnats Wed Aug 31 10:57:50 1994
Received: from wildcat.demon.co.uk (root@wildcat.demon.co.uk [158.152.43.69]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id KAA02128 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 31 Aug 1994 10:57:44 -0700
Message-Id: <199408302112.WAA00223@wildcat.demon.co.uk>
Date: Tue, 30 Aug 1994 22:12:25 +0100
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
Reply-To: alasdair@wildcat.demon.co.uk
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: bug in miscfs/fdesc
X-Send-Pr-Version: 3.2
>Number: 451
>Category: kern
>Synopsis: fdesc file system implements botched /dev/tty
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 31 11:05:11 +0000 1994
>Closed-Date: Mon May 20 16:34:11 +0000 1996
>Last-Modified: Mon May 20 16:34:44 +0000 1996
>Originator: Alasdair Baird
>Release: current (29 Aug 94)
>Organization:
absolutely none whatsoever
>Environment:
System: NetBSD wildcat.demon.co.uk 1.0_BETA NetBSD 1.0_BETA (WILDCAT) #54: Tue Aug 30 21:50:09 BST 1994 root@wildcat.demon.co.uk:/usr/src/sys/arch/i386/compile/WILDCAT i386
>Description:
The fdesc file system, as well as providing /dev/fd/* and the
/dev/std{in,out,err} special files, takes it upon itself to
provide a /dev/tty. Why when there is a perfectly satifactory
one there already is beyond my ken, but fdesc also takes the
opportunity to make it appear a fifo rather than a character
special file. This seems more than slighlty incredibly
perverse, especially when applications expect /dev/tty to be
a character special thingumy.
>How-To-Repeat:
Union mount fdesc file system over /dev, try "ls -l /dev/tty"
while simultaneously keeping a puzzled look off your face at
the "p" in the first column.
>Fix:
I haven't had time to fix it correctly, nor the desire when
there is already a fully functioning /dev/tty---unless someone
can suggest why the following is a bad idea, what follows
merely excises the majority of the /dev/tty functionality from
the fdesc filesystem. (It also fixes/make proper use of a vfs
macro to initialise a vattr structure, for no extra charge.)
It seems to work; certainly my /dev/tty now appears to be a
character special once again.
*** fdesc_vnops.c.orig Tue Aug 30 02:07:18 1994
--- fdesc_vnops.c Tue Aug 30 01:36:07 1994
***************
*** 198,203 ****
--- 198,204 ----
return (0);
}
+ #if 0
if (ap->a_cnp->cn_namelen == 3 && bcmp(pname, "tty", 3) == 0) {
struct vnode *ttyvp = cttyvp(p);
if (ttyvp == NULL) {
***************
*** 212,217 ****
--- 213,219 ----
VOP_LOCK(fvp);
return (0);
}
+ #endif
ln = 0;
switch (ap->a_cnp->cn_namelen) {
***************
*** 396,403 ****
case Fdevfd:
case Flink:
case Fctty:
! bzero((caddr_t) vap, sizeof(*vap));
! vattr_null(vap);
vap->va_fileid = VTOFDESC(vp)->fd_ix;
switch (VTOFDESC(vp)->fd_type) {
--- 398,404 ----
case Fdevfd:
case Flink:
case Fctty:
! VATTR_NULL(vap);
vap->va_fileid = VTOFDESC(vp)->fd_ix;
switch (VTOFDESC(vp)->fd_type) {
***************
*** 517,523 ****
--- 518,526 ----
{ FD_STDIN, UIO_MX, 5, "stdin" },
{ FD_STDOUT, UIO_MX, 6, "stdout" },
{ FD_STDERR, UIO_MX, 6, "stderr" },
+ #if 0
{ FD_CTTY, UIO_MX, 3, "tty" },
+ #endif
{ 0 }
};
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mrg
State-Changed-When: Mon May 20 12:34:11 EDT 1996
State-Changed-Why:
i fixed this some time ago.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.