r7 - trunk

des at projects.linpro.no des at projects.linpro.no
Sat Feb 11 01:04:28 CET 2006


Author: des
Date: 2006-02-11 01:04:28 +0100 (Sat, 11 Feb 2006)
New Revision: 7

Added:
   trunk/system-freebsd.c
   trunk/system-freebsd5.0.c
   trunk/system-freebsd6.0.c
   trunk/system-freebsd7.0.c
Log:
Add FreeBSD implementation of system_init_ncpu().


Added: trunk/system-freebsd.c
===================================================================
--- trunk/system-freebsd.c	2006-02-10 16:05:32 UTC (rev 6)
+++ trunk/system-freebsd.c	2006-02-11 00:04:28 UTC (rev 7)
@@ -0,0 +1,21 @@
+/*
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include "varnish.h"
+#include "log.h"
+#include "system.h"
+
+void
+system_init_ncpu(void)
+{
+	size_t size;
+
+	size = sizeof sys.ncpu;
+	if (sysctlbyname("hw.ncpu", &sys.ncpu, &size, 0, 0) == -1)
+		sys.ncpu = 1;
+	log_info("%d cpu(s)", sys.ncpu);
+}

Added: trunk/system-freebsd5.0.c
===================================================================
--- trunk/system-freebsd5.0.c	2006-02-10 16:05:32 UTC (rev 6)
+++ trunk/system-freebsd5.0.c	2006-02-11 00:04:28 UTC (rev 7)
@@ -0,0 +1 @@
+link system-freebsd.c
\ No newline at end of file


Property changes on: trunk/system-freebsd5.0.c
___________________________________________________________________
Name: svn:special
   + *

Added: trunk/system-freebsd6.0.c
===================================================================
--- trunk/system-freebsd6.0.c	2006-02-10 16:05:32 UTC (rev 6)
+++ trunk/system-freebsd6.0.c	2006-02-11 00:04:28 UTC (rev 7)
@@ -0,0 +1 @@
+link system-freebsd.c
\ No newline at end of file


Property changes on: trunk/system-freebsd6.0.c
___________________________________________________________________
Name: svn:special
   + *

Added: trunk/system-freebsd7.0.c
===================================================================
--- trunk/system-freebsd7.0.c	2006-02-10 16:05:32 UTC (rev 6)
+++ trunk/system-freebsd7.0.c	2006-02-11 00:04:28 UTC (rev 7)
@@ -0,0 +1 @@
+link system-freebsd.c
\ No newline at end of file


Property changes on: trunk/system-freebsd7.0.c
___________________________________________________________________
Name: svn:special
   + *




More information about the varnish-commit mailing list