summaryrefslogtreecommitdiff
path: root/benchmarks/xdd/files/patch-initialization.c
blob: 9444d4af3b025e13c7dc514f5db68a38e5391433 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- initialization.c.orig	Fri Mar 16 06:54:36 2007
+++ initialization.c	Fri Mar 16 06:56:05 2007
@@ -628,7 +628,7 @@
 	 * NOTE: This is not supported by all operating systems. 
 	 */
 	if (p->target_options & RX_SHARED_MEMORY) {
-#if (AIX || LINUX || SOLARIS || OSX)
+#if (AIX || LINUX || SOLARIS || OSX || FreeBSD)
 		/* 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 @@
 		fprintf(xgp->errout,"%s: Shared Memory not supported on this OS - using valloc\n",
 			xgp->progname);
 		p->target_options &= ~RX_SHARED_MEMORY;
-#if (IRIX || SOLARIS || HPUX || LINUX || AIX || ALTIX || OSX)
+#if (IRIX || SOLARIS || HPUX || LINUX || AIX || ALTIX || OSX || FreeBSD)
 		rwbuf = valloc(p->iosize);
 #else
 		rwbuf = malloc(p->iosize);
 #endif
 #endif 
 	} else { /* Allocate memory the normal way */
-#if (IRIX || SOLARIS || HPUX || LINUX || AIX || ALTIX || OSX)
+#if (IRIX || SOLARIS || HPUX || LINUX || AIX || ALTIX || OSX || FreeBSD)
 		rwbuf = valloc(p->iosize);
 #else
 		rwbuf = malloc(p->iosize);
@@ -740,7 +740,7 @@
 	newlim = liret - (PAGESIZE*8);
 	return;
 #else
-#if  (LINUX || SOLARIS || HPUX || OSX || AIX)
+#if  (LINUX || SOLARIS || HPUX || OSX || AIX || FreeBSD)
 	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 @@
 #endif
 	return;
 #else
-#if (IRIX || SOLARIS || HPUX || LINUX || ALTIX || OSX)
+#if (IRIX || SOLARIS || HPUX || LINUX || ALTIX || OSX || FreeBSD)
 	if (getuid() != 0) {
 		return;
 	}
@@ -974,7 +974,7 @@
 	if (xgp->global_options & RX_NOPROCLOCK) 
                 return;
 #if !(OSX)
-#if (IRIX || SOLARIS || HPUX || AIX || LINUX || ALTIX || OSX)
+#if (IRIX || SOLARIS || HPUX || AIX || LINUX || ALTIX || OSX || FreeBSD)
 	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 @@
 		perror("Reason");
 	}
 	if (xgp->global_options & RX_MAXPRI) {
-#if (IRIX || SOLARIS || HPUX || AIX || LINUX || ALTIX || OSX)
+#if (IRIX || SOLARIS || HPUX || AIX || LINUX || ALTIX || OSX || FreeBSD)
 		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 @@
 #endif
 #if (IRIX || SOLARIS || HPUX || AIX || ALTIX)
 	struct stat64 statbuf; /* buffer for file statistics */
-#elif ( LINUX || OSX )
+#elif ( LINUX || OSX || FreeBSD )
 	struct stat statbuf; /* buffer for file statistics */
 #endif
 	int32_t  i; /* working variable */