Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/librumpclient Use kqueue in librumpclient for FreeBSD too



details:   https://anonhg.NetBSD.org/src/rev/2dd29c11b102
branches:  trunk
changeset: 804959:2dd29c11b102
user:      justin <justin%NetBSD.org@localhost>
date:      Mon Dec 08 01:10:07 2014 +0000

description:
Use kqueue in librumpclient for FreeBSD too

diffstat:

 lib/librumpclient/rumpclient.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (65 lines):

diff -r 3ae1223a7ff7 -r 2dd29c11b102 lib/librumpclient/rumpclient.c
--- a/lib/librumpclient/rumpclient.c    Mon Dec 08 00:44:45 2014 +0000
+++ b/lib/librumpclient/rumpclient.c    Mon Dec 08 01:10:07 2014 +0000
@@ -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 @@
 
 #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 @@
 
 #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



Home | Main Index | Thread Index | Old Index