* [Bug 1732] ntpd ties up CPU on disconnected USB refclock.
+* [Bug 1861] tickadj build failure using uClibc.
* Remove kernel line discipline driver code for clk and chu, deprecate
related LDISC_ flags, and remove associated ntpd code to decode the
timestamps, remove clktest line discipline test program.
esac
case "$host" in
- *-*-*linux*)
- AC_CHECK_FUNCS([__adjtimex __ntp_gettime])
- ;;
-esac
-case "$ac_cv_func___adjtimex" in
- yes)
+ *-*-solaris2.6)
+ # Broken...
;;
*)
+ AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
+ ;;
+esac
+
+case "$host" in
+ *-*-*linux*)
+ case "$ac_cv_func_ntp_gettime" in
+ yes)
+ ;;
+ *)
+ AC_CHECK_FUNCS([__ntp_gettime])
+ case "$ac_cv_func___ntp_gettime" in
+ yes)
+ AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
+ AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
+ esac
+ ;;
+ esac
+ AC_CHECK_FUNCS([adjtimex])
+ case "$ac_cv_func_adjtimex" in
+ yes)
+ AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
+ AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
+ ;;
+ *)
+ AC_CHECK_FUNCS([__adjtimex])
+ case "$ac_cv_func___adjtimex" in
+ yes)
+ AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
+ AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
+ AC_DEFINE([adjtimex], [__adjtimex], [deviant])
+ AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
+ esac
+ ;;
+ esac
+esac
+case "$HAVE_ADJTIMEX" in
+ '')
AC_CHECK_LIB([elf], [nlist]) dnl Only needed for tickadj...
dnl AC_CHECK_LIB(kvm, main, , , -lelf)
AC_CHECK_LIB([kvm], [main]) dnl We already know about -lelf here...
case "$ac_cv_header_nlist_h" in
yes)
AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
- esac
- AC_CACHE_CHECK(
- [for n_un in struct nlist],
- [ntp_cv_struct_nlist_n_un],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <nlist.h>
- ]],
- [[
- struct nlist n;
- n.n_un.n_name = 0;
- ]]
+ AC_CACHE_CHECK(
+ [for n_un in struct nlist],
+ [ntp_cv_struct_nlist_n_un],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <nlist.h>
+ ]],
+ [[
+ struct nlist n;
+ n.n_un.n_name = 0;
+ ]]
+ )]
+ [ntp_cv_struct_nlist_n_un=yes],
+ [ntp_cv_struct_nlist_n_un=no]
)]
- [ntp_cv_struct_nlist_n_un=yes],
- [ntp_cv_struct_nlist_n_un=no]
- )]
- )
- case "$ntp_cv_struct_nlist_n_un" in
- yes)
- AC_DEFINE([NLIST_NAME_UNION], [1],
- [does struct nlist use a name union?])
+ )
+ case "$ntp_cv_struct_nlist_n_un" in
+ yes)
+ AC_DEFINE([NLIST_NAME_UNION], [1],
+ [does struct nlist use a name union?])
+ esac
esac
- ;;
esac
AC_CHECK_HEADERS([sys/proc.h], [], [], [
*) AC_CHECK_FUNCS([mlockall])
;;
esac
-AC_CHECK_FUNCS([nice nlist])
-case "$host" in
- *-*-solaris2.6)
- # Broken...
- ;;
- *) AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
- ;;
-esac
-AC_CHECK_FUNCS([plock pututline pututxline readlink recvmsg rtprio])
+AC_CHECK_FUNCS([nice nlist plock pututline pututxline readlink recvmsg rtprio])
case "$host" in
*-*-aix[[456]]*)
# Just a stub in AIX 4. Idiots.
/*
-INFO ON NEW KERNEL PLL SYS CALLS
-
- NTP_SYSCALLS_STD - use the "normal" ones
- NTP_SYSCALL_GET - SYS_ntp_gettime id
- NTP_SYSCALL_ADJ - SYS_ntp_adjtime id
- NTP_SYSCALLS_LIBC - ntp_adjtime() and ntp_gettime() are in libc.
-
HOW TO GET IP INTERFACE INFORMATION
Some UNIX V.4 machines implement a sockets library on top of
LOCK_PROCESS - Have plock.
*/
-#if !defined(HAVE_NTP_ADJTIME) && defined(HAVE___ADJTIMEX)
-# define ntp_adjtime __adjtimex
-#endif
-
int ntp_set_tod (struct timeval *tvp, void *tzp);
#if defined (SYS_CYGWIN32)
#endif
#ifndef NTP_SYSCALLS_LIBC
-#ifdef NTP_SYSCALLS_STD
-# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
-# define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
-#else /* !NTP_SYSCALLS_STD */
-# ifdef HAVE___ADJTIMEX
-extern int __adjtimex (struct timex *);
-
-# define ntp_adjtime(t) __adjtimex((t))
-
-#ifndef HAVE_STRUCT_NTPTIMEVAL
+# ifdef NTP_SYSCALLS_STD
+# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
+# define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
+# else /* !NTP_SYSCALLS_STD */
+# ifdef HAVE_NTP_ADJTIME
+extern int ntp_adjtime (struct timex *);
+
+# ifndef HAVE_STRUCT_NTPTIMEVAL
struct ntptimeval
{
- struct timeval time; /* current time (ro) */
- long int maxerror; /* maximum error (us) (ro) */
- long int esterror; /* estimated error (us) (ro) */
+ struct timeval time; /* current time (ro) */
+ long int maxerror; /* maximum error (us) (ro) */
+ long int esterror; /* estimated error (us) (ro) */
};
-#endif
+# endif
+# ifndef HAVE_NTP_GETTIME
static inline int
ntp_gettime(
struct ntptimeval *ntv
struct timex tntx;
int result;
- tntx.modes = 0;
- result = __adjtimex (&tntx);
+ ZERO(tntx);
+ result = ntp_adjtime(&tntx);
ntv->time = tntx.time;
ntv->maxerror = tntx.maxerror;
ntv->esterror = tntx.esterror;
-#ifdef NTP_API
-# if NTP_API > 3
+# ifdef NTP_API
+# if NTP_API > 3
ntv->tai = tntx.tai;
-# endif
-#endif
- return(result);
+# endif
+# endif
+ return result;
}
-# else /* !HAVE__ADJTIMEX */
-# ifdef HAVE___NTP_GETTIME
-# define ntp_gettime(t) __ntp_gettime((t))
-# endif
-# endif /* !HAVE_ADJTIMEX */
-#endif /* !NTP_SYSCALLS_STD */
-#endif /* !NTP_SYSCALLS_LIBC */
+# endif /* !HAVE_NTP_GETTIME */
+# endif /* !HAVE_NTP_ADJTIME */
+# endif /* !NTP_SYSCALLS_STD */
+#endif /* !NTP_SYSCALLS_LIBC */
-#endif /* NTP_SYSCALL_H */
+#endif /* NTP_SYSCALL_H */
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE___ADJTIMEX /* Linux */
+#ifdef HAVE_SYS_TIMEX_H
+# include <sys/timex.h>
+#endif
+
+#ifdef HAVE_ADJTIMEX /* Linux */
-#include <sys/timex.h>
struct timex txc;
#if 0
txc.tickadj = i;
txc.modes |= ADJ_TICKADJ;
} else {
- (void) fprintf(stderr,
- "%s: unlikely value for tickadj: %s\n",
- progname, ntp_optarg);
+ fprintf(stderr,
+ "%s: unlikely value for tickadj: %s\n",
+ progname, ntp_optarg);
errflg++;
}
break;
}
if (!errflg) {
- if (__adjtimex(&txc) < 0)
+ if (adjtimex(&txc) < 0)
perror("adjtimex");
else if (!quiet)
printf("tick = %ld\ntick_adj = %d\n",
#endif
#endif
}
-
- if (__adjtimex(&txc) < 0)
+
+ if (adjtimex(&txc) < 0)
{
perror("adjtimex");
}
}
#endif
-#else /* not Linux... kmem tweaking: */
+#else /* not Linux... kmem tweaking: */
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>