[ntpsec commit] Remove inscrutable syscall() calls...

Eric S. Raymond esr at ntpsec.org
Wed Sep 30 20:13:13 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    76c3c4e157c0e3848d6e43c5f73ca73f0b2f27a2
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=76c3c4e157c0e3848d6e43c5f73ca73f0b2f27a2

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Wed Sep 30 14:22:40 2015 -0400

Remove inscrutable syscall() calls...

...assume target platform has has either Linux-style adjtimex(2) or BSD-style
ntp_adjtimex(2).  Document this requirement.

---

 INSTALL               |  5 +++--
 include/ntp_syscall.h | 23 ++++++++---------------
 ntpd/ntpd.c           |  8 --------
 3 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/INSTALL b/INSTALL
index 6d66d0a..eb3a91d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -3,8 +3,9 @@
 == Quick Start ==
 
 This software should build on any operating system conformant to
-POSIX.1-2001 and ISO/IEC 9899:1999 (C99).  The primary development
-platforms are Linux and FreeBSD.
+POSIX.1-2001 and ISO/IEC 9899:1999 (C99).  In addition, the
+operating system must have either a Linux-like adjtimex(2) call
+or a BSD-like ntp_adjtime(2) call.
 
 There are some prerequisites.  Libraries need both the library and the
 development headers installed.
diff --git a/include/ntp_syscall.h b/include/ntp_syscall.h
index fd3d7c1..b378aaa 100644
--- a/include/ntp_syscall.h
+++ b/include/ntp_syscall.h
@@ -11,12 +11,7 @@
 # include <sys/timex.h>
 #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_NTP_ADJTIME
+#ifdef HAVE_NTP_ADJTIME
 extern	int	ntp_adjtime	(struct timex *);
 
 struct ntptimeval
@@ -26,7 +21,7 @@ struct ntptimeval
 	long int	esterror;	/* estimated error (us) (ro) */
 };
 
-#   ifndef HAVE_NTP_GETTIME
+# ifndef HAVE_NTP_GETTIME
 static inline int
 ntp_gettime(
 	struct ntptimeval *ntv
@@ -40,16 +35,14 @@ ntp_gettime(
 	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
+#   endif
+#  endif
 	return result;
 }
-#   endif	/* !HAVE_NTP_GETTIME */
-#  endif	/* !HAVE_NTP_ADJTIME */
-# endif	/* !NTP_SYSCALLS_STD */
-#endif	/* !NTP_SYSCALLS_LIBC */
+# endif	/* !HAVE_NTP_GETTIME */
+#endif	/* !HAVE_NTP_ADJTIME */
 
 #endif	/* GUARD_NTP_SYSCALL_H */
diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c
index fa19f05..32a0fe6 100644
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -152,14 +152,6 @@ extern bool	check_netinfo;
 
 bool was_alarmed;
 
-#ifdef DECL_SYSCALL
-/*
- * We put this here, since the argument profile is syscall-specific
- */
-extern int syscall	(int, ...);
-#endif /* DECL_SYSCALL */
-
-
 #if !defined(SIM) && defined(SIGDIE1)
 static	void	finish		(int);
 #endif



More information about the vc mailing list