From owner-freebsd-bugs Thu Jul 24 20:40:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA11395 for bugs-outgoing; Thu, 24 Jul 1997 20:40:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA11372; Thu, 24 Jul 1997 20:40:03 -0700 (PDT) Resent-Date: Thu, 24 Jul 1997 20:40:03 -0700 (PDT) Resent-Message-Id: <199707250340.UAA11372@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, traister@mojozone.org Received: from manta.mojozone.org (root@dfbfl1-6.gate.net [198.206.135.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA11056 for ; Thu, 24 Jul 1997 20:30:59 -0700 (PDT) Received: (from traister@localhost) by manta.mojozone.org (8.8.6/8.8.6) id XAA05743; Thu, 24 Jul 1997 23:30:54 -0400 (EDT) Message-Id: <199707250330.XAA05743@manta.mojozone.org> Date: Thu, 24 Jul 1997 23:30:54 -0400 (EDT) From: Joe Traister Reply-To: traister@mojozone.org To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/4164: pcvt VT_WAITACTIVE ioctl busted Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4164 >Category: kern >Synopsis: pcvt VT_WAITACTIVE ioctl busted >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 24 20:40:01 PDT 1997 >Last-Modified: >Originator: Joe Traister >Organization: None >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: FreeBSD 2.2.2-RELEASE with pcvt console >Description: The pcvt VT_WAITACTIVE ioctl, when passed a 0 third argument, puts the calling process to sleep until the current vt is switched away from. The syscons driver, when passed a 0 third argument, waits until the vt represented by the passed file descriptor is switched to. Both claim to be USL-compatible. I wasn't sure which was correct, but the latter behavior seems more useful, since the former doesn't care whether the current vt is related to the calling process or not. Also, a comment in the pcvt code makes it clear that the author was unsure of the correct behavior. >How-To-Repeat: A code example would be rather involved, but can be provided. A comparison of the code in scioctl() in i386/isa/syscons.c and usl_vt_ioctl() in i386/isa/pcvt/pcvt_ext.c is straightforward. >Fix: *** pcvt_ext.c.dist Mon Jul 21 19:06:36 1997 --- pcvt_ext.c Mon Jul 21 20:40:58 1997 *************** *** 2653,2661 **** if(i == -1) { - /* xxx Is this what it is supposed to do? */ int x = spltty(); ! i = current_video_screen; error = 0; ! while (current_video_screen == i && (error == 0 || error == ERESTART)) { vs[i].vt_status |= VT_WAIT_ACT; --- 2653,2660 ---- if(i == -1) { int x = spltty(); ! i = minor(dev); error = 0; ! while (current_video_screen != i && (error == 0 || error == ERESTART)) { vs[i].vt_status |= VT_WAIT_ACT; >Audit-Trail: >Unformatted: