Subject: Re: kern/30815 -- CVS commit: src/sys/kern (tty.c:1.174)
To: Christos Zoulas <>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
List: current-users
Date: 07/23/2005 18:13:31
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