Import a preview release of Poul-Henning Kamp's new NTP daemon.

Fixes and ok sthen@
This commit is contained in:
naddy 2015-01-14 21:38:32 +00:00
parent ebb4e03fdd
commit 621720f20b
6 changed files with 100 additions and 0 deletions

30
net/ntimed/Makefile Normal file
View File

@ -0,0 +1,30 @@
# $OpenBSD: Makefile,v 1.1.1.1 2015/01/14 21:38:32 naddy Exp $
COMMENT= network time synchronization software
DISTNAME= ntimed-0.0.2015.01.12
CATEGORIES= net
HOMEPAGE= https://github.com/bsdphk/Ntimed
MAINTAINER= Christian Weisgerber <naddy@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM= Yes
GH_ACCOUNT= bsdphk
GH_PROJECT= Ntimed
GH_COMMIT= 3da3e4bde33cf3eafe2158f358a47cbdd69e2c98
WANTLIB= c m
CONFIGURE_STYLE=simple
MAKE_ENV= NOMAN=noman \
BINDIR=${PREFIX}/sbin
pre-configure:
@chmod +x ${WRKSRC}/${CONFIGURE_SCRIPT}
NO_TEST= Yes
.include <bsd.port.mk>

2
net/ntimed/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (ntimed-0.0.2015.01.12.tar.gz) = pQX9UMT41UUM8eMQD6dyBK0/axOCaZrmvxG5w043+H4=
SIZE (ntimed-0.0.2015.01.12.tar.gz) = 33422

View File

@ -0,0 +1,53 @@
$OpenBSD: patch-time_unix_c,v 1.1.1.1 2015/01/14 21:38:32 naddy Exp $
--- time_unix.c.orig Sun Jan 11 20:44:54 2015
+++ time_unix.c Tue Jan 13 20:06:31 2015
@@ -38,7 +38,9 @@
#include <string.h>
#include <sys/time.h>
+#ifndef __OpenBSD__
#include <sys/timex.h>
+#endif
#include "ntimed.h"
@@ -72,9 +74,30 @@ static struct todolist *kt_tdl;
* XXX: Requires TODO cancellation.
*/
+#if defined(__OpenBSD__)
+
static void
kt_setfreq(struct ocx *ocx, double frequency)
{
+ int64_t freq;
+ int i;
+
+ assert(isfinite(frequency));
+
+ freq = frequency * 1e9 * (1LL << 32);
+ errno = 0;
+ i = adjfreq(&freq, NULL);
+ Put(ocx, OCX_TRACE, "KERNPLL %.6e %d\n", frequency, i);
+ /* XXX: what is the correct error test here ? */
+ assert(i >= 0);
+}
+
+
+#else
+
+static void
+kt_setfreq(struct ocx *ocx, double frequency)
+{
struct timex tx;
int i;
@@ -97,6 +120,8 @@ kt_setfreq(struct ocx *ocx, double frequency)
/* XXX: what is the correct error test here ? */
assert(i >= 0);
}
+
+#endif
static enum todo_e __match_proto__(todo_f)
kt_ticker(struct ocx *ocx, struct todolist *tdl, void *priv)

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-udp_c,v 1.1.1.1 2015/01/14 21:38:32 naddy Exp $
--- udp.c.orig Sun Jan 11 20:44:54 2015
+++ udp.c Tue Jan 13 20:07:40 2015
@@ -31,6 +31,7 @@
#include <sys/time.h> /* Compat for NetBSD */
#include <sys/types.h> /* Compat for OpenBSD */
#include <sys/socket.h>
+#include <sys/uio.h>
#include "ntimed.h"
#include "udp.h"

2
net/ntimed/pkg/DESCR Normal file
View File

@ -0,0 +1,2 @@
Preview release of an NTP protocol client daemon which will synchronize
a system's clock to some set of NTP servers.

2
net/ntimed/pkg/PLIST Normal file
View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2015/01/14 21:38:32 naddy Exp $
@bin sbin/ntimed-client