Module Name: src
Committed By: justin
Date: Mon Dec 8 01:10:07 UTC 2014
Modified Files:
src/lib/librumpclient: rumpclient.c
Log Message:
Use kqueue in librumpclient for FreeBSD too
To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/librumpclient/rumpclient.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.62 src/lib/librumpclient/rumpclient.c:1.63
--- src/lib/librumpclient/rumpclient.c:1.62 Fri Apr 25 12:20:12 2014
+++ src/lib/librumpclient/rumpclient.c Mon Dec 8 01:10:07 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpclient.c,v 1.62 2014/04/25 12:20:12 pooka Exp $ */
+/* $NetBSD: rumpclient.c,v 1.63 2014/12/08 01:10:07 justin Exp $ */
/*
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -32,7 +32,7 @@
#include <rump/rumpuser_port.h>
/*
- * We use kqueue on NetBSD, poll elsewhere. Theoretically we could
+ * We use kqueue on NetBSD and FreeBSD, poll elsewhere. We could
* use kqueue on other BSD's too, but I haven't tested those. We
* want to use kqueue because it will give us the ability to get signal
* notifications but defer their handling to a stage where we do not
@@ -43,14 +43,14 @@
* response from the server.
*/
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
#define USE_KQUEUE
#endif
#if defined(__linux__) && !defined(__ANDROID__)
#define USE_SIGNALFD
#endif
-__RCSID("$NetBSD: rumpclient.c,v 1.62 2014/04/25 12:20:12 pooka Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.63 2014/12/08 01:10:07 justin Exp $");
#include <sys/param.h>
#include <sys/mman.h>
@@ -102,8 +102,13 @@ int (*host_dup)(int);
#ifdef USE_KQUEUE
int (*host_kqueue)(void);
+#ifdef __NetBSD__
int (*host_kevent)(int, const struct kevent *, size_t,
struct kevent *, size_t, const struct timespec *);
+#else
+int (*host_kevent)(int, const struct kevent *, int,
+ struct kevent *, int, const struct timespec *);
+#endif
#endif
#ifdef USE_SIGNALFD
@@ -925,11 +930,15 @@ rumpclient_init(void)
#ifdef USE_KQUEUE
FINDSYM(kqueue)
+#ifdef __NetBSD__
#if !__NetBSD_Prereq__(5,99,7)
FINDSYM(kevent)
#else
FINDSYM2(kevent,_sys___kevent50)
#endif
+#else
+ FINDSYM(kevent)
+#endif
#endif /* USE_KQUEUE */
#ifdef USE_SIGNALFD