summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libunixonacid/skaclient_syncify.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libunixonacid/skaclient_syncify.c b/src/libunixonacid/skaclient_syncify.c
new file mode 100644
index 0000000..08b7b9a
--- /dev/null
+++ b/src/libunixonacid/skaclient_syncify.c
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/tai.h>
+#include <skalibs/skaclient.h>
+
+int skaclient_syncify (skaclient_t *a, tain_t const *deadline, tain_t *stamp)
+{
+ register int r ;
+ if (!skaclient_timed_flush(a, deadline, stamp)) return 0 ;
+ r = skaclient_timed_supdate(a, deadline, stamp) ;
+ return r < 0 ? 0 : !r ? (errno = EPIPE, 0) : 1 ;
+}