aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/xdd/files/patch-initialization.c
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2012-04-15 11:43:13 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2012-04-15 11:43:13 +0000
commitf72153f000874e7008fe18d16a3cfe1a0e71ca97 (patch)
treeb6cc4c63eb9263b64789a00a6bff16dd73d983f2 /benchmarks/xdd/files/patch-initialization.c
parent8726c3d5bce406a60019bbb9ef53bc9e27ab152a (diff)
- Enhances detection of CPU count
- fixes compile time warnings with string.hg not being included in xdd.h PR: ports/165197 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: g.gonter@ieee.org (maintainer, timeout 60 days)
Notes
Notes: svn path=/head/; revision=294846
Diffstat (limited to 'benchmarks/xdd/files/patch-initialization.c')
-rw-r--r--benchmarks/xdd/files/patch-initialization.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/benchmarks/xdd/files/patch-initialization.c b/benchmarks/xdd/files/patch-initialization.c
index 9444d4af3b02..f09f9c5e28e1 100644
--- a/benchmarks/xdd/files/patch-initialization.c
+++ b/benchmarks/xdd/files/patch-initialization.c
@@ -1,6 +1,19 @@
---- initialization.c.orig Fri Mar 16 06:54:36 2007
-+++ initialization.c Fri Mar 16 06:56:05 2007
-@@ -628,7 +628,7 @@
+--- initialization.c.orig 2012-02-09 19:46:52.785072682 -0800
++++ initialization.c 2012-02-15 21:58:34.759136156 -0800
+@@ -181,11 +181,7 @@
+ fprintf(out, "Computer Name, %s, User Name, %s\n",name.nodename, getlogin());
+ fprintf(out, "OS release and version, %s %s %s\n",name.sysname, name.release, name.version);
+ fprintf(out, "Machine hardware type, %s\n",name.machine);
+-#if (SOLARIS)
+- xgp->number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);
+- physical_pages = sysconf(_SC_PHYS_PAGES);
+- page_size = sysconf(_SC_PAGE_SIZE);
+-#elif (AIX)
++#if (SOLARIS || AIX || FreeBSD)
+ xgp->number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);
+ physical_pages = sysconf(_SC_PHYS_PAGES);
+ page_size = sysconf(_SC_PAGE_SIZE);
+@@ -628,7 +624,7 @@
* NOTE: This is not supported by all operating systems.
*/
if (p->target_options & RX_SHARED_MEMORY) {
@@ -9,7 +22,7 @@
/* In AIX we need to get memory in a shared memory segment to avoid
* the system continually trying to pin each page on every I/O operation */
#if (AIX)
-@@ -656,14 +656,14 @@
+@@ -656,14 +652,14 @@
fprintf(xgp->errout,"%s: Shared Memory not supported on this OS - using valloc\n",
xgp->progname);
p->target_options &= ~RX_SHARED_MEMORY;
@@ -26,7 +39,7 @@
rwbuf = valloc(p->iosize);
#else
rwbuf = malloc(p->iosize);
-@@ -740,7 +740,7 @@
+@@ -740,7 +736,7 @@
newlim = liret - (PAGESIZE*8);
return;
#else
@@ -35,7 +48,7 @@
if (getuid() != 0) {
fprintf(xgp->errout,"(PID %d) %s: You must run as superuser to lock memory for %s\n",
getpid(),xgp->progname, sp);
-@@ -889,7 +889,7 @@
+@@ -889,7 +885,7 @@
#endif
return;
#else
@@ -44,7 +57,7 @@
if (getuid() != 0) {
return;
}
-@@ -974,7 +974,7 @@
+@@ -974,7 +970,7 @@
if (xgp->global_options & RX_NOPROCLOCK)
return;
#if !(OSX)
@@ -53,7 +66,7 @@
if (getuid() != 0)
fprintf(xgp->errout,"%s: xdd_schedule_options: You must be super user to lock processes\n",xgp->progname);
#endif
-@@ -985,7 +985,7 @@
+@@ -985,7 +981,7 @@
perror("Reason");
}
if (xgp->global_options & RX_MAXPRI) {
@@ -62,7 +75,7 @@
if (getuid() != 0)
fprintf(xgp->errout,"%s: xdd_schedule_options: You must be super user to max priority\n",xgp->progname);
#endif
-@@ -1127,7 +1127,7 @@
+@@ -1127,7 +1123,7 @@
#endif
#if (IRIX || SOLARIS || HPUX || AIX || ALTIX)
struct stat64 statbuf; /* buffer for file statistics */