Subject: Xntpd serial port handling broken in -current
To: None <current-users@NetBSD.ORG>
From: Tom Ivar Helbekkmo <tih+mail@Hamartun.Priv.NO>
List: current-users
Date: 05/01/1998 18:44:21
There's a problem with the F_SETOWN ioctl in the configuration of
xntpd that's in -current.  I've got a radio clock hooked up to one of
my serial ports, and I get this when xntpd starts:

May  1 18:26:54 barsoom xntpd[170]: 5.90 3-NetBSD Thu Apr 17 17:15:47 EDT 1997 (1)
May  1 18:26:54 barsoom xntpd[170]: tickadj = 40, tick = 10000, tvu_maxslew = 3960, est. hz = 100
May  1 18:26:54 barsoom xntpd[170]: precision = 29 usec
May  1 18:26:54 barsoom xntpd[170]: fcntl(F_SETOWN) fails for clock I/O: Inappropriate ioctl for device
May  1 18:26:55 barsoom xntpd[170]: PARSE receiver #1: parse_start: addclock /dev/refclock-1 fails (ABORT - clock type requires async io)
May  1 18:26:55 barsoom xntpd[170]: configuration of 127.127.8.1 failed

The problem is easily fixed -- it's right there in the xntp2netbsd
script, where we find:

/* must we have a CTTY for fsetown? */
/* #undef USE_FSETOWNCTTY */

This should be:

/* must we have a CTTY for fsetown? */
#define USE_FSETOWNCTTY

...since we don't allow an F_SETOWN ioctl on anything that isn't the
controlling terminal.

Modification tested locally, and found to work right.

-tih
-- 
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"