Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 1995 11:48:23 -0700
From:      stu@cisco.com (Stu Phillips)
To:        Warner Losh <imp@village.org>, Paul Traina <pst@cisco.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: FleeBSD and XNTPD
Message-ID:  <v02110116ac9f1d404aa0@[171.69.60.153]>

next in thread | raw e-mail | index | archive | help
At 11:31 AM 10/9/95, Warner Losh wrote:
>: That's utterly bizzare that async IO isn't working on the serial lines,
>I seem
>: to recall using it way back a million years ago.
>
>TIA runs on 2.0R w/o any problems.  It would have big problems if
>async I/O was broken for serial lines....
>
>Don't know what the deal is, but TIA just does a fcntl of the fd with
>the O_NONBLOCK bit set after reading the flags on fd 0.


Hope I've not started a fire storm here.... I'm running 2.1.0-950928-SNAP.

Here's the code snarfed from xntpd/xntpd/ntp_io.c...  The first two ioctl
calls were added by me in an effort to debug what is going on....  Basically
either the ioctl(TIOCSPGRP) call or the fcntl(F_SETOWN) both fail with
... (extracted from syslog)...

Timestamps elided for brevity..

xntpd[1353]:xntpd version=3.4e (beta multicast); Sat Oct  7 17:11:29 PDT 1995
xntpd[1353]:tickadj = 5, tick = 10000, tvu_maxslew = 495
xntpd[1353]:refclock_ioctl: optional clk line discipline unsupported
xntpd[1353]:ioctl(TIOCSPGRP) fails for clock I/O: Inappropriate ioctl for device
xntpd[1353]: configuration of 127.127.20.1 failed


#endif /* AIX && !BSD */
#ifndef  CLOCK_DONE
static int
init_clock_sig(rio)
        struct refclockio *rio;
{
        int pgrp = getpid();
        int ldisc = TTYDISC;

        if (ioctl(rio->fd, TIOCSETD, (char*)&ldisc) == -1) {
                syslog(LOG_ERR, "ioctl(TIOCSETD) fails for clock I/O: %m");
                return 1;
        }

        if (ioctl(rio->fd, TIOCSPGRP, (char*)&pgrp) == -1) {
                syslog(LOG_ERR, "ioctl(TIOCSPGRP) fails for clock I/O: %m");
                return 1;
        }

        /*
        if (fcntl(rio->fd, F_SETOWN, getpid()) == -1) {
                syslog(LOG_ERR, "fcntl(F_SETOWN) fails for clock I/O: %m");
                return 1;
        }
        */

        if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0) {
                syslog(LOG_ERR,
                    "fcntl(FNDELAY|FASYNC) fails for clock I/O: %m");
                return 1;
        }
        return 0;
}


This is trying to get the NMEA clock driver to function - xntp builds
squeeky clean but the above barfs.

Stu






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v02110116ac9f1d404aa0>