NetBSD Problem Report #1560
From gnats Mon Oct 2 15:46:33 1995
Received: from eterna.com.au (splode.mame.mu.OZ.AU [128.250.209.121]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id PAA00315 for <gnats-bugs@gnats.netbsd.org>; Mon, 2 Oct 1995 15:46:19 -0400
Message-Id: <199510011435.AAA04791@eterna.com.au>
Date: Mon, 2 Oct 1995 00:35:40 +1000
From: mrg@eterna.com.au
Reply-To: mrg@eterna.com.au
To: gnats-bugs@gnats.netbsd.org
Subject: compat_sunos doesn't have a vhangup()
X-Send-Pr-Version: 3.95
>Number: 1560
>Category: kern
>Synopsis: compat_sunos doesn't have a vhangup()
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 02 15:50:39 +0000 1995
>Closed-Date: Fri Jan 05 16:53:18 +0000 1996
>Last-Modified: Fri Jan 05 16:54:44 +0000 1996
>Originator: matthew green
>Release: sep 30 '95
>Organization:
bozotic softwar foundation
>Environment:
System: NetBSD splode.eterna.com.au 1.0A NetBSD 1.0A (_splode_) #254: Wed Sep 27 02:39:05 EST 1995 mrg@splode.eterna.com.au:/orb/q/build/src/sys/arch/sparc/compile/_splode_ sparc
>Description:
the compat_sunos (and, incidentaly, osf1, linux, svr4 and ultrix)
does not have a working vhangup() syscall emulation. patch below
provides this.
>How-To-Repeat:
>Fix:
i've done what the sunos 4 and sunos 5 man pages say vhangup does:
revoking access to the ctty of the calling process, to all processes,
and, then sending a SIGHUP to the process group of the ctty.
there is similar code in exit1() that does the hup first, then a
ttywait() and then the vgoneall(). i implimented them with the
vgoneall() first here because that's what the manual pages describes.
i haven't called ttywait() because i'm unsure whether or not it is
needed here.
the osf1, linux, svr4 and ultrix compat modules could probably use
this patch almost directly, as none of these impliment a vhangup()
syscall either.
this hasn't been tested, either, though, it does compile :-)
i don't have a sunos program that uses vhangup handy that actually
works (in.telnetd was my attempt...).
Index: sunos_misc.c
===================================================================
RCS file: /local/cvs/src/sys/compat/sunos/sunos_misc.c,v
retrieving revision 1.6
diff -c -r1.6 sunos_misc.c
*** sunos_misc.c 1995/10/01 02:52:15 1.6
--- sunos_misc.c 1995/10/01 13:40:21
***************
*** 74,79 ****
--- 74,80 ----
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
+ #include <sys/tty.h>
#include <sys/vnode.h>
#include <sys/uio.h>
#include <sys/wait.h>
***************
*** 736,746 ****
}
int
! sunos_vhangup(p, uap, retval)
struct proc *p;
! void *uap;
register_t *retval;
{
return 0;
}
--- 737,757 ----
}
int
! sunos_vhangup(p, v, retval)
struct proc *p;
! void *v;
register_t *retval;
{
+ struct sunos_vhangup_args *uap = v;
+ struct session *sp = p->p_session;
+
+ if (sp->s_ttyvp)
+ vgoneall(sp->s_ttyvp);
+ if (sp->s_ttyp && sp->s_ttyp->t_pgrp)
+ pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1);
+ #if 0 /* kern_exit.c does the ttywait. should we here ? */
+ (void) ttywait(sp->s_ttyp);
+ #endif
return 0;
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: pk
State-Changed-When: Fri Jan 5 11:53:18 EST 1996
State-Changed-Why:
Added to revision 1.60 of sunos_misc.c.
>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.