Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/librumpuser Provide an implementation of writewatchfile ...
details: https://anonhg.NetBSD.org/src/rev/16cb326ab082
branches: trunk
changeset: 783856:16cb326ab082
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Jan 10 19:13:04 2013 +0000
description:
Provide an implementation of writewatchfile for platforms without kqueue
or inotify (it's a rather simple implementation ;)
diffstat:
lib/librumpuser/rumpuser.c | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diffs (50 lines):
diff -r 805aabe0c5d6 -r 16cb326ab082 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c Thu Jan 10 17:40:10 2013 +0000
+++ b/lib/librumpuser/rumpuser.c Thu Jan 10 19:13:04 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.c,v 1.25 2012/12/14 10:48:48 pooka Exp $ */
+/* $NetBSD: rumpuser.c,v 1.26 2013/01/10 19:13:04 pooka Exp $ */
/*
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.25 2012/12/14 10:48:48 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.26 2013/01/10 19:13:04 pooka Exp $");
#endif /* !lint */
#include <sys/ioctl.h>
@@ -696,6 +696,31 @@
}
return (nn/sizeof(iev));
}
+
+#else
+
+/* a polling default implementation */
+int
+rumpuser_writewatchfile_setup(int inotify, int fd, intptr_t notused, int *error)
+{
+ static int warned = 0;
+
+ if (!warned) {
+ fprintf("WARNING: rumpuser writewatchfile routines are "
+ "polling-only on this platform\n");
+ warned = 1;
+ }
+
+ return 0;
+}
+
+int
+rumpuser_writewatchfile_wait(int kq, intptr_t *opaque, int *error)
+{
+
+ KLOCK_WRAP(usleep(10000));
+ return 0;
+}
#endif
/*
Home |
Main Index |
Thread Index |
Old Index