Subject: Re: ntp port request
To: None <current-users@NetBSD.ORG>
From: Torsten Duwe (Emacs) <Torsten.Duwe@informatik.uni-erlangen.de>
List: current-users
Date: 02/10/1996 02:47:58
Tom I. Helbekkmo writes:
 > On Mon, 5 Feb 1996, Jan-Hinrich Fessel wrote:
 > 
 > > > xntpd 3.4y compiles on NetBSD 1.0 and later "out of the box".  I've used 
I've put up a 3.4z pre-release out on
ftp.uni-erlangen.de:/pub/Linux/LOCAL/xntp/
(Don't get irritated by the "Linux" :-)

 > > > it on the i386, hp300, and mac68k ports without trouble.
 > > 
 > > Anyone successfully using a parse refclock with that release?
 > 
 > I'm running the raw DCF77 variant under NetBSD/i386 1.1A almost right
 > out of the box with no problems.  I use the clk_rawdcf.c PARSE driver
 > to read the PPS signal from a cheap DCF77 receiver, level converted
 > onto a serial port, and the only change needed was to the section for
 > NetBSD in the file include/ntp_machine.h, which needs to do:
 > 
 > 	#define USE_FSETOWNCTTY
 > 

I was thinking about putting it into the source, but I'd much rather make it
conditional e. g. #if NetBSD < 199602. This will get fixed some day won't it ?

 > The bit of code that uses it is in xntpd/ntp_io.c, and this #define
 > will cause it to set the serial port to be the controlling terminal
 > before doing a fcntl(fd, F_SETOWN, pid) on it.
 > 
 > I would assume that this is a "wrong" solution -- it seems to me that
 > this makes it impossible to run more than one PARSE clock at a time
 > with the xntpd, and that's a silly limitation.  I just haven't found
 > the time to look into it yet...  Meanwhile, I'm doing just fine with a
 > single refclock, thank you!  :-)
 > 

You're correct. The problem is in /sys/kern/kern_descrip.c line 240-255:

        case F_SETOWN:
                if (fp->f_type == DTYPE_SOCKET) {
[...]
                }
                return ((*fp->f_ops->fo_ioctl)
                        (fp, (int)TIOCSPGRP, (caddr_t)&SCARG(uap, arg), p));

        case F_SETLKW:

F_SETOWN ought to be implemented instead of simply being mapped to setpgrp,
because the latter is allowed only on the controlling terminal. A quick hack
would be to simply lift this limitation, but - hey - this isn't Linux.

I tried to send-pr this, but it got lost during the sun-lamp shipment. Will
some kind soul please take care of this ? Will another send-pr help ?

	Torsten