[comp.archives] [apollo...] Re: XNTPD on an Apollo?

rees@pisa.ifs.umich.edu (Jim Rees) (01/02/91)

Archive-name: internet/ntp/xntp-apollo/1990-12-31
Archive: dabo.ifs.umich.edu:Readme.xntp [141.211.168.73]
Original-posting-by: rees@pisa.ifs.umich.edu (Jim Rees)
Original-subject: Re: XNTPD on an Apollo?
Reposted-by: emv@ox.com (Edward Vielmetti)

In article <HANCHE.90Dec29001324@hufsa.imf.unit.no>, hanche@imf.unit.no (Harald Hanche-Olsen) writes:

  I have been trying to port xntpd to the Apollo, and have run into
  trouble.  What xntpd does is open a bunch of UDP sockets, and set them
  up to send an IO signal whenever input arrives by saying
  
    fcntl(fd, F_SETOWN, getpid())

I'm not sure why the manual says this is not implemented.  It is.

In Berkeley Unix, only sockets can be owned by a single process.  If you try
to set the owner of a tty to a process, it ends up being owned by the group
that process is in.

In Domain/OS, you can't set either sockets or ttys to be owned by an
individual process.  They are always owned by a process group.

The problem with xntpd is that when you start it up, it doesn't divorce
itself from its process group.  So when it does the SETOWN, the socket ends
up being owned by the group of the process that started xntpd, not the group
that xntpd is currently in.

You can fix this by adding a setpgrp().  ntpdate has the same problem.

You can get a set of patches for xntpd from dabo.ifs.umich.edu.