From owner-freebsd-hackers Mon Oct 9 11:47:20 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA18705 for hackers-outgoing; Mon, 9 Oct 1995 11:47:20 -0700 Received: from feta.cisco.com (feta.cisco.com [171.69.1.158]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA18700 for ; Mon, 9 Oct 1995 11:47:19 -0700 Received: from [171.69.60.153] (sphillips-mac.cisco.com [171.69.60.153]) by feta.cisco.com (8.6.8+c/CISCO.SERVER.1.1) with SMTP id LAA28230; Mon, 9 Oct 1995 11:46:34 -0700 X-Sender: stu@feta.cisco.com Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 9 Oct 1995 11:48:23 -0700 To: Warner Losh , Paul Traina From: stu@cisco.com (Stu Phillips) Subject: Re: FleeBSD and XNTPD Cc: hackers@FreeBSD.ORG Sender: owner-hackers@FreeBSD.ORG Precedence: bulk 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