--- xntp3-5.93/xntpd/ntp_refclock.c~	Sat Apr 25 01:56:34 1998
+++ xntp3-5.93/xntpd/ntp_refclock.c	Mon Nov 30 23:07:48 1998
@@ -31,6 +31,9 @@
 
 #ifdef PPS
 #include <sys/ppsclock.h>
+#if defined(__linux__) /* Linux hack: define PPS interface */
+#include <linux/serial.h>
+#endif
 #endif /* PPS */
 
 /*
@@ -1187,6 +1190,29 @@
 		return (0);
 	}
 #endif /* CHUCLK */
+#if defined(__linux__)	/* Linux hack */
+	if (flags & LDISC_PPS) {
+		struct serial_struct	ss;
+		errno = 0;
+		if (fdpps != -1) {
+			msyslog(LOG_WARNING,
+			"refclock_ioctl: PPS already on fd %d; can't use fd %d",
+				fdpps, fd);
+			return(0);
+		}
+		if (ioctl(fd, TIOCGSERIAL, &ss) < 0 ||
+		    (ss.flags |= ASYNC_PPS_CD_POS,
+ 		     ioctl(fd, TIOCSSERIAL, &ss)) < 0) {
+			msyslog(LOG_NOTICE, "refclock_ioctl: fd %d, %m", fd);
+ 			msyslog(LOG_NOTICE,
+ 		"refclock_ioctl: optional PPS processing not available");
+		} else {
+			msyslog(LOG_INFO,
+				"refclock_ioctl: PPS detect on fd %d", fd);
+ 			fdpps = fd;
+		}
+	}
+#endif
 #endif /* HAVE_TERMIOS */
 
 #ifdef HAVE_BSD_TTYS
