Subject: Re: kern/30815 -- CVS commit: src/sys/kern (tty.c:1.174)
To: None <,,>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
List: netbsd-bugs
Date: 07/23/2005 16:52:01
The following reply was made to PR kern/30815; it has been noted by GNATS.

From: Frank Kardel <Frank.Kardel@Acrys.COM>
To: Christos Zoulas <>
Cc:, Geoff Wing <>,
Subject: Re: kern/30815 -- CVS commit: src/sys/kern (tty.c:1.174)
Date: Sat, 23 Jul 2005 18:13:31 +0200

 Christos Zoulas wrote:
 >In article <>,
 >Geoff Wing  <> wrote:
 >>Christos Zoulas <> typed:
 >>: Modified Files:
 >>: 	src/sys/kern: tty.c
 >>: Log Message:
 >>: Allow F{G,S}OWN to succeed on a tty that has no session associated with it,
 >>: and it is not the controlling tty. This change allows us to use SIGIO on
 >>: a non-controlling tty (eg. debug ntpd with a refclock on a tty).
 >>This has killed my com port mouse under XFree 4.5.0 (i386).  Previously
 >>with a working mouse /var/log/XFree86.0.log would have
 >> (WW) fcntl(6, F_SETOWN): Inappropriate ioctl for device
 >>Anything obvious to anyone else?  (before I have to kickstart my brain)
 >I don't know, it seems to me that before it was returning EPERM, and now
 >it is returning EINVAL. It should have been failing before too.
 It also breaks ntpd in its new form (no CTTY allocation) - see 
 kern/30815 for details.
 Problem is that pgsignal() is called with an arg3 of 1 (=check tty) 
 meaning that signal
 should only be posted to processes having a controlling termical 
 in p->p_flag).
 Thus there is he second check for a CTTY.
 Looking at the code I think it is enough to call pgsignal with arg3 = 0 
 (no check
 for P_CONTROLT) in ttwakeup() as SIGIO is sent there.
 All other uses of pgsignal with arg3=1
 are ok as those signals should ONLY be sent to processes with a P_CONTROLT
 Is this analysis correct ? If so it should resolve the issues with X and