Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser FreeBSD and DragonFly also provide hosts cpu...



details:   https://anonhg.NetBSD.org/src/rev/666e22583ef6
branches:  trunk
changeset: 783302:666e22583ef6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Dec 14 10:48:48 2012 +0000

description:
FreeBSD and DragonFly also provide hosts cpus via sysctl hw.ncpu.

diffstat:

 lib/librumpuser/rumpuser.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r fe2c5d242a1f -r 666e22583ef6 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c        Fri Dec 14 09:48:31 2012 +0000
+++ b/lib/librumpuser/rumpuser.c        Fri Dec 14 10:48:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.c,v 1.24 2012/12/13 15:35:09 pooka Exp $      */
+/*     $NetBSD: rumpuser.c,v 1.25 2012/12/14 10:48:48 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.24 2012/12/13 15:35:09 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.25 2012/12/14 10:48:48 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/ioctl.h>
@@ -41,8 +41,11 @@
 #include <sys/disk.h>
 #include <sys/disklabel.h>
 #include <sys/dkio.h>
+#include <sys/event.h>
+#endif
+
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #include <sys/sysctl.h>
-#include <sys/event.h>
 #endif
 
 #include <assert.h>
@@ -733,7 +736,7 @@
 {
        int ncpu = 1;
 
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
        size_t sz = sizeof(ncpu);
 
        sysctlbyname("hw.ncpu", &ncpu, &sz, NULL, 0);



Home | Main Index | Thread Index | Old Index