Subject: Re: kern/30815: ntpd refclockio broken wrt/ SIGIO
To: Christos Zoulas <email@example.com>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
Date: 07/25/2005 22:34:41
Christos Zoulas wrote:
>On Jul 23, 1:30pm, firstname.lastname@example.org (email@example.com) wrote:
>-- Subject: kern/30815: ntpd refclockio broken wrt/ SIGIO
>| The recent relaxation to allow SIGIO on tty descriptors without
>| requiring TIOCSCTTY is incomplete. Current version 1.9 of
>| usr.sbin/ntp/include/config.h has USE_FSETOWNCTTY commented out.
>| So ntpd doesn't aquire a CTTY. Fact is that currently TTY input
>| does not cause a SIGIO to be delivered in this setup.
>| ntpd pretends to run because of network SIGIOs, but ntpd is
>| unable to actually use a tty refclock as input on a TTY as
>| input is batched in intervals of network caused SIGIOs.
>| So, currently ntpd refclock support is broken.
>Does the code set FIOASYNC?
Yep. As you can see in the ktraces in 30815 the only difference id the
The relevant section in libntp/iosignal.c is:
# if defined(TIOCSCTTY) && defined(USE_FSETOWNCTTY)
* there are, however, always exceptions to the rules
* one is, that OSF accepts SETOWN on TTY fd's only, iff
* CTTYs. SunOS and HPUX do not semm to have this
* another question is: how can you do multiple SIGIO
* ttys (as they all should be CTTYs), wondering...
* kd 95-07-16
if (ioctl(rio->fd, TIOCSCTTY, 0) == -1)
msyslog(LOG_ERR, "ioctl(TIOCSCTTY, 0) fails for
# endif /* TIOCSCTTY && USE_FSETOWNCTTY */
if (fcntl(rio->fd, F_SETOWN, getpid()) == -1)
msyslog(LOG_ERR, "fcntl(F_SETOWN) fails for
clock I/O: %
if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0)
"fcntl(FNDELAY|FASYNC) fails for clock
As you can see the CTTY is a long standing issue (see my comment from
and I'd be all too happy if it improves on NetBSD.
I'll give 1.175 a shot - I just saw it coming in.