View | Details | Raw Unified | Return to bug 211152 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-2 / +2 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	iozone
4
PORTNAME=	iozone
5
DISTVERSION=	3_434
5
DISTVERSION=	3_444
6
CATEGORIES=	benchmarks
6
CATEGORIES=	benchmarks
7
MASTER_SITES=	http://www.iozone.org/src/current/
7
MASTER_SITES=	http://www.iozone.org/src/current/
8
DISTNAME=	${PORTNAME}${DISTVERSION}
8
DISTNAME=	${PORTNAME}${DISTVERSION}
Lines 12-18 Link Here
12
12
13
WRKSRC=		${WRKDIR}/${DISTNAME}/src/current
13
WRKSRC=		${WRKDIR}/${DISTNAME}/src/current
14
14
15
USES=		tar
15
USES=		tar:tgz
16
MAKEFILE=	makefile
16
MAKEFILE=	makefile
17
MAKE_ARGS=	${MAKE_ENV}
17
MAKE_ARGS=	${MAKE_ENV}
18
ALL_TARGET=	freebsd
18
ALL_TARGET=	freebsd
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1466168535
1
TIMESTAMP = 1468829143
2
SHA256 (iozone3_434.tar) = 2c388d9db393a5505b31eca38951883744c69745f687f3c7df5185b4681d462a
2
SHA256 (iozone3_444.tgz) = 715f14910e9cb2adda46500e343474a3a8bf9dbd688dfdd4e432af55d838c2bd
3
SIZE (iozone3_434.tar) = 1843200
3
SIZE (iozone3_444.tgz) = 823479
(-)files/patch-iozone.c (-140 / +443 lines)
Lines 1-154 Link Here
1
Fix warnings from modern compilers -- formats, use of 0 instead of NULL.
1
--- iozone.c.orig	2016-07-17 01:34:04 UTC
2
Also remove redundant casts and fix printf-formatting.
3
4
	-mi
5
--- iozone.c	2015-10-20 14:12:13.000000000 +0000
6
+++ iozone.c
2
+++ iozone.c
7
@@ -8679,5 +8679,5 @@
3
@@ -351,6 +351,10 @@ typedef long long off64_t;
8
 			if(r_traj_flag)
4
 typedef off_t off64_t;
9
 			{
5
 #endif
10
-				traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&compute_time, (long)0);
11
+				traj_offset=get_traj(r_traj_fd, &traj_size, &compute_time, 0);
12
 				reclen=traj_size;
13
 #if defined(Windows)
14
@@ -14765,5 +14765,5 @@
15
 		if(r_traj_flag)
16
 		{
17
-			traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
18
+			traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
19
 			reclen=traj_size;
20
 #if defined(Windows)
21
@@ -15318,5 +15318,5 @@
22
 		if(r_traj_flag)
23
 		{
24
-			traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
25
+			traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
26
 			reclen=traj_size;
27
 			I_LSEEK(fd,traj_offset,SEEK_SET);
28
@@ -15878,5 +15878,5 @@
29
 		if(r_traj_flag)
30
 		{
31
-			traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
32
+			traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
33
 			reclen=traj_size;
34
 #if defined(Windows)
35
@@ -18745,11 +18745,5 @@
36
 	int xx;
37
 	int *yy;
38
-#ifdef _64BIT_ARCH_
39
-	long long meme;
40
-	meme = (long long)x;
41
-#else
42
-	long meme;
43
-	meme = (long)x;
44
-#endif
45
+	intptr_t meme = (intptr_t)x;
46
 	yy=(int *)x;
47
 
6
 
48
@@ -18770,6 +18764,6 @@
7
+#if defined(__FreeBSD__)
49
 	if(debug1 )
8
+#define __off64_t_defined
9
+typedef off_t off64_t;
10
+#endif
11
 
12
 #ifndef solaris
13
 #ifndef off64_t
14
@@ -360,6 +364,7 @@ typedef off_t off64_t;
15
 #ifndef SCO_Unixware_gcc
16
 #ifndef UWIN
17
 #ifndef __DragonFly__
18
+#ifndef __FreeBSD__
19
 typedef long long off64_t;
20
 #endif
21
 #endif
22
@@ -369,6 +374,7 @@ typedef long long off64_t;
23
 #endif
24
 #endif
25
 #endif
26
+#endif
27
 
28
 #ifdef __AIX__
29
 #include <fcntl.h>
30
@@ -1918,7 +1924,7 @@ char **argv;
31
 #ifdef NO_PRINT_LLD
32
 			sscanf(optarg,"%ld",&kilobytes64);
33
 #else
34
-			sscanf(optarg,"%lld",&kilobytes64);
35
+			sscanf(optarg,"%lld",&kilobytes64);
36
 #endif
37
 			if(optarg[strlen(optarg)-1]=='k' ||
38
 				optarg[strlen(optarg)-1]=='K'){
39
@@ -1942,7 +1948,7 @@ char **argv;
40
 #ifdef NO_PRINT_LLD
41
 	    		sprintf(splash[splash_line++],"\tFile size set to %ld kB\n",kilobytes64);
42
 #else
43
-	    		sprintf(splash[splash_line++],"\tFile size set to %lld kB\n",kilobytes64);
44
+	    		sprintf(splash[splash_line++],"\tFile size set to %lld kB\n",(long long)kilobytes64);
45
 #endif
46
 			sflag++;
47
 			break;
48
@@ -2316,7 +2322,7 @@ char **argv;
49
 #ifdef NO_PRINT_LLD
50
 			sprintf(splash[splash_line++],"\tUsing minimum file size of %ld kilobytes.\n",minimum_file_size);
51
 #else
52
-			sprintf(splash[splash_line++],"\tUsing minimum file size of %lld kilobytes.\n",minimum_file_size);
53
+			sprintf(splash[splash_line++],"\tUsing minimum file size of %lld kilobytes.\n",(long long)minimum_file_size);
54
 #endif
55
 			break;
56
 		case 'g':	/* Set maximum file size for auto mode */
57
@@ -2339,7 +2345,7 @@ char **argv;
58
 #ifdef NO_PRINT_LLD
59
 			sprintf(splash[splash_line++],"\tUsing maximum file size of %ld kilobytes.\n",maximum_file_size);
60
 #else
61
-			sprintf(splash[splash_line++],"\tUsing maximum file size of %lld kilobytes.\n",maximum_file_size);
62
+			sprintf(splash[splash_line++],"\tUsing maximum file size of %lld kilobytes.\n",(long long)maximum_file_size);
63
 #endif
64
 			break;
65
 		case 'z':	/* Set no cross over */
66
@@ -2447,7 +2453,7 @@ char **argv;
67
 					#ifdef NO_PRINT_LLD
68
 						sscanf(subarg,"%ld",&burst_size_kb_64);
69
 					#else
70
-						sscanf(subarg,"%lld",&burst_size_kb_64);
71
+						sscanf(subarg,"%lld",&burst_size_kb_64);
72
 					#endif
73
 					if(subarg[strlen(subarg)-1]=='k' ||
74
 						subarg[strlen(subarg)-1]=='K'){
75
@@ -3109,7 +3115,7 @@ char **argv;
76
 		burst_size_kb_64, burst_sleep_duration_msec);
77
 #else
78
 		printf("\tBurst size set to %lld Kbytes.\n\tBurst sleep duration set to %lld msec\n",
79
-		burst_size_kb_64, burst_sleep_duration_msec);
80
+		(long long)burst_size_kb_64, burst_sleep_duration_msec);
81
 #endif
82
 	if(!rflag)
83
 		reclen=(long long)4096;
84
@@ -3345,7 +3351,7 @@ long long reclength;
85
 		if(!silent) printf("%8ld",reclen/1024);
86
 	}
87
 #else
88
-	if(!silent) printf("%16lld",kilobytes64);
89
+	if(!silent) printf("%16lld",(long long)kilobytes64);
90
 	if(r_traj_flag || w_traj_flag)
50
 	{
91
 	{
51
-		printf("\nthread created has an id of %lx\n",ts);
92
 		if(!silent) printf("%8lld",(long long )0);
52
-		printf("meme %ld\n",meme);
93
@@ -3403,7 +3409,7 @@ long long reclength;
53
+		printf("\nthread created has an id of %p\n", ts);
94
 	    	printf("\n\tiozone %ld %ld ", kilobytes64,  goodrecl);
54
+		printf("meme %lld\n", (long long)meme);
95
 	    	printf("\t(i.e. record size = %ld bytes)\n",  goodrecl);
96
 #else
97
-	    	printf("\n\tiozone %lld %lld ", kilobytes64,  goodrecl);
98
+	    	printf("\n\tiozone %lld %lld ", (long long)kilobytes64,  goodrecl);
99
 	    	printf("\t(i.e. record size = %lld bytes)\n",  goodrecl);
100
 #endif
101
 	   }
102
@@ -3544,7 +3550,7 @@ void auto_test()
103
                                 min_rec_size,min_file_size);
104
 #else
105
             printf("Error: record length %lld is greater than filesize %lld kB\n ",
106
-                                min_rec_size,min_file_size);
107
+                                min_rec_size,(long long)min_file_size);
108
 #endif
109
                 exit(23);
110
         }
111
@@ -3739,7 +3745,7 @@ throughput_test()
112
 		port,kilobytes64);
113
 #else
114
 	if(!silent) printf("\tEach %s writes a %lld kByte file in telemetry controlled records\n",
115
-		port,kilobytes64);
116
+		port,(long long)kilobytes64);
117
 #endif
55
 	}
118
 	}
56
 	return((long long)meme);
119
 	else
57
@@ -22167,5 +22161,5 @@
120
@@ -3749,7 +3755,7 @@ throughput_test()
58
 			fflush(newstdout);
121
 		port,kilobytes64,reclen/1024);
122
 #else
123
 	if(!silent) printf("\tEach %s writes a %lld kByte file in %lld kByte records\n",
124
-		port,kilobytes64,reclen/1024);
125
+		port,(long long)kilobytes64,reclen/1024);
126
 #endif
127
 	}
128
 
129
@@ -7182,8 +7188,8 @@ char sverify;
130
 	printf("where %8.8lx loop %ld\n",where,i);
131
 #else
132
 	printf("Error in file: Found ?%llx? Expecting ?%llx? addr %lx\n",*where, (long long)((pattern_buf<<32)|pattern_buf),((long)where));
133
-	printf("Error in file: Position %lld \n",file_position);
134
-	printf("Record # %lld Record size %lld kb \n",recnum,recsize/1024);
135
+	printf("Error in file: Position %lld \n",(long long)file_position);
136
+	printf("Record # %lld Record size %lld kb \n",(long long)recnum,recsize/1024);
137
 	printf("where %px loop %lld\n",where,(long long)i);
138
 #endif
139
 		   return(1);
140
@@ -7226,9 +7232,9 @@ char sverify;
141
 	printf("Error in file: Position %ld \n",file_position);
142
 	printf("Record # %ld Record size %ld kb \n",recnum,recsize/1024);
143
 #else
144
-	printf("Error in file: Position %lld %lld %lld \n",i,j,k);
145
-	printf("Error in file: Position %lld \n",file_position);
146
-	printf("Record # %lld Record size %lld kb \n",recnum,recsize/1024);
147
+	printf("Error in file: Position %lld %lld %lld \n",(long long)i,j,k);
148
+	printf("Error in file: Position %lld \n",(long long)file_position);
149
+	printf("Record # %lld Record size %lld kb \n",(long long)recnum,recsize/1024);
150
 #endif
151
 	printf("Found pattern: Char >>%c<< Expecting >>%c<<\n", *where2,*pattern_ptr);
152
 	printf("Found pattern: Hex >>%x<< Expecting >>%x<<\n", *where2,*pattern_ptr);
153
@@ -7835,9 +7841,9 @@ long long *data2;
154
 				else
155
 				fprintf(rwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
156
 #else
157
-				fprintf(wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
158
+				fprintf(wqfd,"%10.1lld %10.0f %10.1lld\n",((long long)traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
159
 				else
160
-				fprintf(rwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
161
+				fprintf(rwqfd,"%10.1lld %10.0f %10.1lld\n",((long long)traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
162
 #endif
163
 			}
164
 			w_traj_ops_completed++;
165
@@ -8331,7 +8337,7 @@ long long *data1,*data2;
166
 				printf("\nError freading block %lu %lx\n", i,
167
 					(unsigned long long)buffer);
168
 #else
169
-				printf("\nError freading block %llu %llx\n", i,
170
+				printf("\nError freading block %llu %llx\n", (long long)i,
171
 					(unsigned long long)buffer);
172
 #endif
173
 #else
174
@@ -8749,7 +8755,7 @@ long long *data1,*data2;
175
 				printf("\nError reading block %ld %lx\n", i,
176
 					(unsigned long long)nbuff);
177
 #else
178
-				printf("\nError reading block %lld %llx\n", i,
179
+				printf("\nError reading block %lld %llx\n", (long long)i,
180
 					(unsigned long long)nbuff);
181
 #endif
182
 #else
183
@@ -8798,9 +8804,9 @@ long long *data1,*data2;
184
 				else
185
 				fprintf(rrqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
186
 #else
187
-				fprintf(rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
188
+				fprintf(rqfd,"%10.1lld %10.0f %10.1lld\n",((long long)traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
189
 				else
190
-				fprintf(rrqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
191
+				fprintf(rrqfd,"%10.1lld %10.0f %10.1lld\n",((long long)traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
192
 #endif
193
 			}
194
 			r_traj_ops_completed++;
195
@@ -9227,7 +9233,7 @@ long long *data1, *data2;
196
 					 offset64); 
197
 #else
198
 				 printf("\nError reading block at %lld\n",
199
-					 offset64); 
200
+					 (long long)offset64); 
201
 #endif
202
 				 perror("read");
203
 				 exit(70);
204
@@ -9351,7 +9357,7 @@ long long *data1, *data2;
205
 							offset64); 
206
 #else
207
 						printf("\nError writing block at %lld\n",
208
-							offset64); 
209
+							(long long)offset64); 
210
 #endif
211
 						if(wval==-1)
212
 							perror("write");
213
@@ -9667,7 +9673,7 @@ long long *data1,*data2;
214
 #ifdef NO_PRINT_LLD
215
 					printf("\nError reading block %ld\n", i); 
216
 #else
217
-					printf("\nError reading block %lld\n", i); 
218
+					printf("\nError reading block %lld\n", (long long)i); 
219
 #endif
220
 					perror("read");
221
 					exit(79);
222
@@ -10272,8 +10278,8 @@ long long *data1, *data2;
223
 		    		printf("\nError reading block %ld, fd= %d Filename %s Read returned %ld\n", i, fd,filename,uu);
224
 		    		printf("\nSeeked to %ld Reclen = %ld\n", savepos64,reclen);
225
 #else
226
-		    		printf("\nError reading block %lld, fd= %d Filename %s Read returned %lld\n", i, fd,filename,uu);
227
-		    		printf("\nSeeked to %lld Reclen = %lld\n", savepos64,reclen);
228
+		    		printf("\nError reading block %lld, fd= %d Filename %s Read returned %lld\n", (long long)i, fd,filename,uu);
229
+		    		printf("\nSeeked to %lld Reclen = %lld\n", (long long)savepos64,reclen);
230
 #endif
231
 				perror("read");
232
 		    		exit(88);
233
@@ -11799,7 +11805,7 @@ long long who;
234
 #ifdef NO_PRINT_LLD
235
 		if(!silent) printf("  %c%ld%c",'"',rec_size/1024,'"');
236
 #else
237
-		if(!silent) printf("  %c%lld%c",'"',rec_size/1024,'"');
238
+		if(!silent) printf("  %c%lld%c",'"',(long long)rec_size/1024,'"');
239
 #endif
240
 	}
241
 	if(!silent) printf("\n");
242
@@ -11817,7 +11823,7 @@ long long who;
243
 #ifdef NO_PRINT_LLD
244
 	if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
245
 #else
246
-	if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
247
+	if(!silent) printf("%c%lld%c  ",'"',(long long)current_file_size,'"');
248
 #endif
249
 	for(i=0;i<=max_y;i++){
250
 		if(report_array[0][i] != current_file_size){
251
@@ -11832,7 +11838,7 @@ long long who;
252
 #ifdef NO_PRINT_LLD
253
 			if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
254
 #else
255
-			if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
256
+			if(!silent) printf("%c%lld%c  ",'"',(long long)current_file_size,'"');
257
 #endif
59
 		}
258
 		}
60
-		thread_write_test((long)0);
259
 		if(bif_flag)
61
+		thread_write_test(NULL);
260
@@ -11840,7 +11846,7 @@ long long who;
62
 		break;
261
 #ifdef NO_PRINT_LLD
63
 #ifdef HAVE_PREAD
262
 		if(!silent) printf(" %ld ",report_array[who][i]);
64
@@ -22176,5 +22170,5 @@
263
 #else
65
 			fflush(newstdout);
264
-		if(!silent) printf(" %lld ",report_array[who][i]);
265
+		if(!silent) printf(" %lld ",(long long)report_array[who][i]);
266
 #endif
267
 	}
268
 	if(bif_flag)
269
@@ -12029,7 +12035,7 @@ long long who;
270
 #ifdef NO_PRINT_LLD
271
 		if(!silent) printf("  %c%ld%c",'"',rec_size/1024,'"');
272
 #else
273
-		if(!silent) printf("  %c%lld%c",'"',rec_size/1024,'"');
274
+		if(!silent) printf("  %c%lld%c",'"',(long long)rec_size/1024,'"');
275
 #endif
276
 	}
277
 	if(!silent) printf("\n");
278
@@ -12047,7 +12053,7 @@ long long who;
279
 #ifdef NO_PRINT_LLD
280
 	if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
281
 #else
282
-	if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
283
+	if(!silent) printf("%c%lld%c  ",'"',(long long)current_file_size,'"');
284
 #endif
285
 	for (i = 0; i <= max_y; i++) {
286
 		if (report_array[0][i] != current_file_size) {
287
@@ -12062,7 +12068,7 @@ long long who;
288
 #ifdef NO_PRINT_LLD
289
 			if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
290
 #else
291
-			if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
292
+			if(!silent) printf("%c%lld%c  ",'"',(long long)current_file_size,'"');
293
 #endif
66
 		}
294
 		}
67
-		thread_pwrite_test((long)0);
295
 		if (bif_flag)
68
+		thread_pwrite_test(NULL);
296
@@ -13061,7 +13067,7 @@ printf("Desired rate %g  Actual rate %g 
69
 		break;
297
 #ifdef NO_PRINT_LLD
298
 			fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
299
 #else
300
-			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
301
+			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
70
 #endif
302
 #endif
71
@@ -22185,5 +22179,5 @@
72
 			fflush(newstdout);
73
 		}
303
 		}
74
-		thread_rwrite_test((long)0);
304
 		w_traj_ops_completed++;
75
+		thread_rwrite_test(NULL);
305
@@ -13715,7 +13721,7 @@ printf("Desired rate %g  Actual rate %g 
76
 		break;
306
 #ifdef NO_PRINT_LLD
77
 	case THREAD_READ_TEST : 
307
 			fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
78
@@ -22193,5 +22187,5 @@
308
 #else
79
 			fflush(newstdout);
309
-			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
310
+			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
311
 #endif
80
 		}
312
 		}
81
-		thread_read_test((long)0);
313
 		w_traj_ops_completed++;
82
+		thread_read_test(NULL);
314
@@ -14325,7 +14331,7 @@ printf("Desired rate %g  Actual rate %g 
83
 		break;
315
 #ifdef NO_PRINT_LLD
84
 #ifdef HAVE_PREAD
316
 			fprintf(thread_rwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
85
@@ -22202,5 +22196,5 @@
317
 #else
86
 			fflush(newstdout);
318
-			fprintf(thread_rwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
319
+			fprintf(thread_rwqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
320
 #endif
87
 		}
321
 		}
88
-		thread_pread_test((long)0);
322
 		if(rlocking)
89
+		thread_pread_test(NULL);
323
@@ -14840,7 +14846,7 @@ thread_read_test(x)
90
 		break;
324
 		    		printf("\nError reading block %ld, fd= %d\n", i,
325
 					 fd);
326
 #else
327
-		    		printf("\nError reading block %lld, fd= %d\n", i,
328
+		    		printf("\nError reading block %lld, fd= %d\n", (long long)i,
329
 					 fd);
91
 #endif
330
 #endif
92
@@ -22211,5 +22205,5 @@
331
 				perror("read");
93
 			fflush(newstdout);
332
@@ -14914,7 +14920,7 @@ printf("Desired rate %g  Actual rate %g 
333
 #ifdef NO_PRINT_LLD
334
                         fprintf(thread_rqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
335
 #else
336
-                        fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
337
+                        fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
338
 #endif
339
                 }
340
 
341
@@ -15375,7 +15381,7 @@ thread_pread_test(x)
342
 		    		printf("\nError preading block %ld, fd= %d\n", i,
343
 					 fd);
344
 #else
345
-		    		printf("\nError preading block %lld, fd= %d\n", i,
346
+		    		printf("\nError preading block %lld, fd= %d\n", (long long)i,
347
 					 fd);
348
 #endif
349
 				perror("pread");
350
@@ -15449,7 +15455,7 @@ printf("Desired rate %g  Actual rate %g 
351
 #ifdef NO_PRINT_LLD
352
                         fprintf(thread_rqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
353
 #else
354
-                        fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
355
+                        fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
356
 #endif
357
                 }
358
 
359
@@ -15953,7 +15959,7 @@ thread_rread_test(x)
360
 		    		printf("\nError writing block %ld, fd= %d\n", i,
361
 					 fd);
362
 #else
363
-		    		printf("\nError writing block %lld, fd= %d\n", i,
364
+		    		printf("\nError writing block %lld, fd= %d\n", (long long)i,
365
 					 fd);
366
 #endif
367
 				perror("read");
368
@@ -16027,7 +16033,7 @@ printf("Desired rate %g  Actual rate %g 
369
 #ifdef NO_PRINT_LLD
370
                         fprintf(thread_rrqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
371
 #else
372
-                        fprintf(thread_rrqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
373
+                        fprintf(thread_rrqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
374
 #endif
375
                 }
376
 
377
@@ -16503,7 +16509,7 @@ thread_reverse_read_test(x)
378
 #ifdef NO_PRINT_LLD
379
 				printf("\nError reading block %ld\n", i); 
380
 #else
381
-				printf("\nError reading block %lld\n", i); 
382
+				printf("\nError reading block %lld\n", (long long)i); 
383
 #endif
384
 				perror("read");
385
 				if (!no_unlink)
386
@@ -16585,7 +16591,7 @@ printf("Desired rate %g  Actual rate %g 
387
 #ifdef NO_PRINT_LLD
388
                         fprintf(thread_revqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
389
 #else
390
-                        fprintf(thread_revqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
391
+                        fprintf(thread_revqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
392
 #endif
393
                 }
394
 	}
395
@@ -17013,7 +17019,7 @@ thread_stride_read_test(x)
396
 #ifdef NO_PRINT_LLD
397
 		    		printf("\nError reading block %ld, fd= %d\n", i, fd);
398
 #else
399
-		    		printf("\nError reading block %lld, fd= %d\n", i, fd);
400
+		    		printf("\nError reading block %lld, fd= %d\n", (long long)i, fd);
401
 #endif
402
 				perror("read");
403
 				if (!no_unlink)
404
@@ -17130,7 +17136,7 @@ printf("Desired rate %g  Actual rate %g 
405
 #ifdef NO_PRINT_LLD
406
                         fprintf(thread_strqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
407
 #else
408
-                        fprintf(thread_strqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
409
+                        fprintf(thread_strqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
410
 #endif
411
                 }
412
 	}
413
@@ -17737,7 +17743,7 @@ thread_ranread_test(x)
414
 					 offset); 
415
 #else
416
 				printf("\nError reading block at %lld\n",
417
-					 offset); 
418
+					 (long long)offset); 
419
 #endif
420
 				perror("ranread");
421
 				if (!no_unlink)
422
@@ -17814,7 +17820,7 @@ printf("Desired rate %g  Actual rate %g 
423
 #ifdef NO_PRINT_LLD
424
                         fprintf(thread_randrfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
425
 #else
426
-                        fprintf(thread_randrfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
427
+                        fprintf(thread_randrfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
428
 #endif
429
                 }
430
 	}
431
@@ -18492,7 +18498,7 @@ printf("Desired rate %g  Actual rate %g 
432
 #ifdef NO_PRINT_LLD
433
 			fprintf(thread_randwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
434
 #else
435
-			fprintf(thread_randwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
436
+			fprintf(thread_randwqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
437
 #endif
94
 		}
438
 		}
95
-		thread_rread_test((long)0);
439
 		w_traj_ops_completed++;
96
+		thread_rread_test(NULL);
440
@@ -25030,7 +25036,7 @@ void * thread_fwrite_test( x)
97
 		break;
441
 #ifdef NO_PRINT_LLD
98
 	case THREAD_STRIDE_TEST : 
442
 			fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
99
@@ -22219,5 +22213,5 @@
443
 #else
100
 			fflush(newstdout);
444
-			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
445
+			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
446
 #endif
101
 		}
447
 		}
102
-		thread_stride_read_test((long)0);
448
                 w_traj_ops_completed++;
103
+		thread_stride_read_test(NULL);
449
@@ -25489,7 +25495,7 @@ void * thread_fread_test( x)
104
 		break;
450
 #ifdef NO_PRINT_LLD
105
 	case THREAD_RANDOM_READ_TEST : 
451
 			fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
106
@@ -22227,5 +22221,5 @@
452
 #else
107
 			fflush(newstdout);
453
-			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
454
+			fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(long long)(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
455
 #endif
108
 		}
456
 		}
109
-		thread_ranread_test((long)0);
457
                 w_traj_ops_completed++;
110
+		thread_ranread_test(NULL);
111
 		break;
112
 	case THREAD_RANDOM_WRITE_TEST : 
113
@@ -22235,5 +22229,5 @@
114
 			fflush(newstdout);
115
 		}
116
-		thread_ranwrite_test((long)0);
117
+		thread_ranwrite_test(NULL);
118
 		break;
119
 	case THREAD_REVERSE_READ_TEST : 
120
@@ -22243,5 +22237,5 @@
121
 			fflush(newstdout);
122
 		}
123
-		thread_reverse_read_test((long)0);
124
+		thread_reverse_read_test(NULL);
125
 		break;
126
 	case THREAD_RANDOM_MIX_TEST : 
127
@@ -22251,5 +22245,5 @@
128
 			fflush(newstdout);
129
 		}
130
-		thread_mix_test((long)0);
131
+		thread_mix_test(NULL);
132
 		break;
133
 	case THREAD_FWRITE_TEST : 
134
@@ -22259,5 +22253,5 @@
135
 			fflush(newstdout);
136
 		}
137
-		thread_fwrite_test((long)0);
138
+		thread_fwrite_test(NULL);
139
 		break;
140
 	case THREAD_FREAD_TEST : 
141
@@ -22267,5 +22261,5 @@
142
 			fflush(newstdout);
143
 		}
144
-		thread_fread_test((long)0);
145
+		thread_fread_test(NULL);
146
 		break;
147
 	case THREAD_CLEANUP_TEST : 
148
@@ -22275,5 +22269,5 @@
149
 			fflush(newstdout);
150
 		}
151
-		thread_cleanup_test((long)0);
152
+		thread_cleanup_test(NULL);
153
 		break;
154
 	};
(-)files/patch-libasync.c (-963 lines)
Lines 1-963 Link Here
1
The bulk of this patch eliminates the gratutious differences between
2
LP64, LARGEFILE64 and normal cases. The differences are dealt with
3
in one location and the rest of the code need not differ.
4
5
Most of the other changes deal with printf-formats (%zd for ssize_t
6
and the like) and other warnings.
7
8
	-mi
9
--- libasync.c	2015-10-20 14:12:13.000000000 +0000
10
+++ libasync.c
11
@@ -97,4 +97,13 @@
12
 #include <sys/types.h>
13
 #include <aio.h>
14
+
15
+#if defined(_LARGEFILE64_SOURCE) && !defined(__LP64__)
16
+#	define aio_error	aio_error64
17
+#	define aio_return	aio_return64
18
+#	define aio_read 	aio_read64
19
+#	define aio_cancel	aio_cancel64
20
+#	define aio_write	aio_write64
21
+#endif
22
+
23
 #if defined(solaris) || defined(linux) || defined(SCO_Unixware_gcc) || defined(__NetBSD__)
24
 #else
25
@@ -133,9 +142,13 @@
26
 #endif
27
 
28
-void mbcopy(char *source, char *dest, size_t len);
29
+static void mbcopy(const char *source, char *dest, size_t len);
30
 
31
 
32
 #if !defined(solaris) && !defined(off64_t) && !defined(_OFF64_T) && !defined(__off64_t_defined) && !defined(SCO_Unixware_gcc)
33
+#	if defined(bsd4_4)
34
+typedef off_t off64_t;
35
+#	else
36
 typedef long long off64_t;
37
+#	endif
38
 #endif
39
 #if defined(OSFV5)
40
@@ -151,13 +164,14 @@
41
  * this structure type.
42
  */
43
-char version[] = "Libasync Version $Revision: 3.25 $";
44
+static const char version[] = "Libasync Version $Revision: 3.25 $";
45
 struct cache_ent {
46
-	struct aiocb myaiocb;			/* For use in small file mode */
47
 #ifdef _LARGEFILE64_SOURCE 
48
 #if defined(__CrayX1__)
49
-	aiocb64_t myaiocb64;		/* For use in large file mode */
50
+	aiocb64_t myaiocb;		/* For use in large file mode */
51
 #else
52
-	struct aiocb64 myaiocb64;		/* For use in large file mode */
53
-#endif 
54
+	struct aiocb64 myaiocb;		/* For use in large file mode */
55
+#endif
56
+#else
57
+	struct aiocb myaiocb;
58
 #endif 
59
 	long long fd;				/* File descriptor */
60
@@ -192,6 +205,6 @@
61
 long long max_depth;
62
 extern int errno;
63
-struct cache_ent *alloc_cache();
64
-struct cache_ent *incache();
65
+static struct cache_ent *alloc_cache();
66
+static struct cache_ent *incache();
67
 void async_init();
68
 void end_async();
69
@@ -275,5 +288,5 @@
70
 	const struct aiocb * const cblist[1] = {&ce->myaiocb};
71
 #else
72
-	const struct aiocb64 * const cblist[1] = {&ce->myaiocb64};
73
+	const struct aiocb64 * const cblist[1] = {&ce->myaiocb};
74
 #endif
75
 #else
76
@@ -348,87 +361,26 @@
77
 	if((ce=(struct cache_ent *)incache(gc,fd,offset,size)))
78
 	{
79
-#ifdef _LARGEFILE64_SOURCE 
80
-#ifdef __LP64__
81
 		while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
82
 		{
83
 			async_suspend(ce);
84
 		}
85
-#else
86
-		while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
87
-		{
88
-			async_suspend(ce);
89
-		}
90
-#endif
91
-#else
92
-		while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
93
-		{
94
-			async_suspend(ce);
95
-		}
96
-#endif
97
 		if(ret)
98
 		{
99
-			printf("aio_error 1: ret %d %d\n",ret,errno);
100
+			printf("aio_error 1: ret %zd %d\n",ret,errno);
101
 		}
102
-#ifdef _LARGEFILE64_SOURCE 
103
-#ifdef __LP64__
104
 		retval=aio_return(&ce->myaiocb);
105
-#else
106
-#if defined(__CrayX1__)
107
-		retval=aio_return64((aiocb64_t *)&ce->myaiocb64);
108
-#else
109
-		retval=aio_return64((struct aiocb64 *)&ce->myaiocb64);
110
-#endif
111
-
112
-#endif
113
-#else
114
-		retval=aio_return(&ce->myaiocb);
115
-#endif
116
 		if(retval > 0)
117
 		{
118
-#ifdef _LARGEFILE64_SOURCE 
119
-#ifdef __LP64__
120
 			mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
121
-#else
122
-			mbcopy((char *)ce->myaiocb64.aio_buf,(char *)ubuffer,(size_t)retval);
123
-#endif
124
-#else
125
-			mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
126
-#endif
127
 		}
128
-#ifdef _LARGEFILE64_SOURCE 
129
-#ifdef __LP64__
130
-		if(retval < ce->myaiocb.aio_nbytes)
131
-#else
132
-		if(retval < ce->myaiocb64.aio_nbytes)
133
-#endif
134
-#else
135
 		if(retval < ce->myaiocb.aio_nbytes)
136
-#endif
137
 		{
138
-			printf("aio_return error1: ret %d %d\n",retval,errno);
139
-#ifdef _LARGEFILE64_SOURCE 
140
-#ifdef __LP64__
141
-			printf("aio_return error1: fd %d offset %ld buffer %lx size %d Opcode %d\n",
142
-				ce->myaiocb.aio_fildes,
143
-				ce->myaiocb.aio_offset,
144
-				(long)(ce->myaiocb.aio_buf),
145
-				ce->myaiocb.aio_nbytes,
146
-				ce->myaiocb.aio_lio_opcode
147
-#else
148
-			printf("aio_return error1: fd %d offset %lld buffer %lx size %d Opcode %d\n",
149
-				ce->myaiocb64.aio_fildes,
150
-				ce->myaiocb64.aio_offset,
151
-				(long)(ce->myaiocb64.aio_buf),
152
-				ce->myaiocb64.aio_nbytes,
153
-				ce->myaiocb64.aio_lio_opcode
154
-#endif
155
-#else
156
-			printf("aio_return error1: fd %d offset %d buffer %lx size %d Opcode %d\n",
157
+			printf("aio_return error1: ret %zd %d\n",retval,errno);
158
+			printf("aio_return error1: fd %d offset %lld buffer %p size %zd Opcode %d\n",
159
 				ce->myaiocb.aio_fildes,
160
-				ce->myaiocb.aio_offset,
161
-				(long)(ce->myaiocb.aio_buf),
162
+				(long long)ce->myaiocb.aio_offset,
163
+				ce->myaiocb.aio_buf,
164
 				ce->myaiocb.aio_nbytes,
165
 				ce->myaiocb.aio_lio_opcode
166
-#endif
167
 				);
168
 		}
169
@@ -444,13 +396,5 @@
170
 		first_ce=alloc_cache(gc,fd,offset,size,(long long)LIO_READ);
171
 again:
172
-#ifdef _LARGEFILE64_SOURCE 
173
-#ifdef __LP64__
174
 		ret=aio_read(&first_ce->myaiocb);
175
-#else
176
-		ret=aio_read64(&first_ce->myaiocb64);
177
-#endif
178
-#else
179
-		ret=aio_read(&first_ce->myaiocb);
180
-#endif
181
 		if(ret!=0)
182
 		{
183
@@ -458,5 +402,5 @@
184
 				goto again;
185
 			else
186
-				printf("error returned from aio_read(). Ret %d errno %d\n",ret,errno);
187
+				printf("error returned from aio_read(). Ret %zd errno %d\n",ret,errno);
188
 		}
189
 	}
190
@@ -483,13 +427,5 @@
191
 			continue;
192
 		ce=alloc_cache(gc,fd,r_offset,a_size,(long long)LIO_READ);
193
-#ifdef _LARGEFILE64_SOURCE 
194
-#ifdef __LP64__
195
-		ret=aio_read(&ce->myaiocb);
196
-#else
197
-		ret=aio_read64(&ce->myaiocb64);
198
-#endif
199
-#else
200
 		ret=aio_read(&ce->myaiocb);
201
-#endif
202
 		if(ret!=0)
203
 		{
204
@@ -501,81 +437,25 @@
205
 	if(del_read)	/* Wait for the first read to complete */
206
 	{
207
-#ifdef _LARGEFILE64_SOURCE 
208
-#ifdef __LP64__
209
 		while((ret=aio_error(&first_ce->myaiocb))== EINPROGRESS)
210
 		{
211
 			async_suspend(first_ce);
212
 		}
213
-#else
214
-		while((ret=aio_error64(&first_ce->myaiocb64))== EINPROGRESS)
215
-		{
216
-			async_suspend(first_ce);
217
-		}
218
-#endif
219
-#else
220
-		while((ret=aio_error(&first_ce->myaiocb))== EINPROGRESS)
221
-		{
222
-			async_suspend(first_ce);
223
-		}
224
-#endif
225
 		if(ret)
226
-			printf("aio_error 2: ret %d %d\n",ret,errno);
227
-#ifdef _LARGEFILE64_SOURCE 
228
-#ifdef __LP64__
229
-		retval=aio_return(&first_ce->myaiocb);
230
-#else
231
-		retval=aio_return64(&first_ce->myaiocb64);
232
-#endif
233
-#else
234
+			printf("aio_error 2: ret %zd %d\n",ret,errno);
235
 		retval=aio_return(&first_ce->myaiocb);
236
-#endif
237
-#ifdef _LARGEFILE64_SOURCE 
238
-#ifdef __LP64__
239
-		if(retval < first_ce->myaiocb.aio_nbytes)
240
-#else
241
-		if(retval < first_ce->myaiocb64.aio_nbytes)
242
-#endif
243
-#else
244
 		if(retval < first_ce->myaiocb.aio_nbytes)
245
-#endif
246
 		{
247
-			printf("aio_return error2: ret %d %d\n",retval,errno);
248
-#ifdef _LARGEFILE64_SOURCE 
249
-#ifdef __LP64__
250
-			printf("aio_return error2: fd %d offset %lld buffer %lx size %d Opcode %d\n",
251
+			printf("aio_return error2: ret %zd %d\n",retval,errno);
252
+			printf("aio_return error2: fd %d offset %lld buffer %p size %zd Opcode %d\n",
253
 				first_ce->myaiocb.aio_fildes,
254
-				first_ce->myaiocb.aio_offset,
255
-				(long)(first_ce->myaiocb.aio_buf),
256
+				(long long)first_ce->myaiocb.aio_offset,
257
+				first_ce->myaiocb.aio_buf,
258
 				first_ce->myaiocb.aio_nbytes,
259
 				first_ce->myaiocb.aio_lio_opcode
260
-#else
261
-			printf("aio_return error2: fd %d offset %lld buffer %lx size %d Opcode %d\n",
262
-				first_ce->myaiocb64.aio_fildes,
263
-				first_ce->myaiocb64.aio_offset,
264
-				(long)(first_ce->myaiocb64.aio_buf),
265
-				first_ce->myaiocb64.aio_nbytes,
266
-				first_ce->myaiocb64.aio_lio_opcode
267
-#endif
268
-#else
269
-			printf("aio_return error2: fd %d offset %d buffer %lx size %d Opcode %d\n",
270
-				first_ce->myaiocb.aio_fildes,
271
-				first_ce->myaiocb.aio_offset,
272
-				(long)(first_ce->myaiocb.aio_buf),
273
-				first_ce->myaiocb.aio_nbytes,
274
-				first_ce->myaiocb.aio_lio_opcode
275
-#endif
276
 				);
277
 		}
278
 		if(retval > 0)
279
 		{
280
-#ifdef _LARGEFILE64_SOURCE 
281
-#ifdef __LP64__
282
-			mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
283
-#else
284
-			mbcopy((char *)first_ce->myaiocb64.aio_buf,(char *)ubuffer,(size_t)retval);
285
-#endif
286
-#else
287
 			mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
288
-#endif
289
 		}
290
 		first_ce->direct=0;
291
@@ -602,5 +482,5 @@
292
 {
293
 	struct cache_ent *ce;
294
-	long temp;
295
+	intptr_t temp;
296
 	ce=(struct cache_ent *)malloc((size_t)sizeof(struct cache_ent));
297
 	if(ce == (struct cache_ent *)0)
298
@@ -610,31 +490,11 @@
299
 	}
300
 	bzero(ce,sizeof(struct cache_ent));
301
-#ifdef _LARGEFILE64_SOURCE 
302
-#ifdef __LP64__
303
 	ce->myaiocb.aio_fildes=(int)fd;
304
 	ce->myaiocb.aio_offset=(off64_t)offset;
305
-	ce->real_address = (char *)malloc((size_t)(size+page_size));
306
-	temp=(long)ce->real_address;
307
-	temp = (temp+page_size) & ~(page_size-1);
308
-	ce->myaiocb.aio_buf=(volatile void *)temp;
309
-	if(ce->myaiocb.aio_buf == 0)
310
-#else
311
-	ce->myaiocb64.aio_fildes=(int)fd;
312
-	ce->myaiocb64.aio_offset=(off64_t)offset;
313
-	ce->real_address = (char *)malloc((size_t)(size+page_size));
314
-	temp=(long)ce->real_address;
315
-	temp = (temp+page_size) & ~(page_size-1);
316
-	ce->myaiocb64.aio_buf=(volatile void *)temp;
317
-	if(ce->myaiocb64.aio_buf == 0)
318
-#endif
319
-#else
320
-	ce->myaiocb.aio_fildes=(int)fd;
321
-	ce->myaiocb.aio_offset=(off_t)offset;
322
-	ce->real_address = (char *)malloc((size_t)(size+page_size));
323
-	temp=(long)ce->real_address;
324
+	ce->real_address = malloc((size_t)(size+page_size));
325
+	temp = (intptr_t)ce->real_address;
326
 	temp = (temp+page_size) & ~(page_size-1);
327
 	ce->myaiocb.aio_buf=(volatile void *)temp;
328
-	if(ce->myaiocb.aio_buf == 0)
329
-#endif
330
+	if(ce->myaiocb.aio_buf == NULL)
331
 	{
332
 		printf("Malloc failed\n");
333
@@ -642,22 +502,8 @@
334
 	}
335
 	/*bzero(ce->myaiocb.aio_buf,(size_t)size);*/
336
-#ifdef _LARGEFILE64_SOURCE 
337
-#ifdef __LP64__
338
-	ce->myaiocb.aio_reqprio=0;
339
-	ce->myaiocb.aio_nbytes=(size_t)size;
340
-	ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
341
-	ce->myaiocb.aio_lio_opcode=(int)op;
342
-#else
343
-	ce->myaiocb64.aio_reqprio=0;
344
-	ce->myaiocb64.aio_nbytes=(size_t)size;
345
-	ce->myaiocb64.aio_sigevent.sigev_notify=SIGEV_NONE;
346
-	ce->myaiocb64.aio_lio_opcode=(int)op;
347
-#endif
348
-#else
349
 	ce->myaiocb.aio_reqprio=0;
350
 	ce->myaiocb.aio_nbytes=(size_t)size;
351
 	ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
352
 	ce->myaiocb.aio_lio_opcode=(int)op;
353
-#endif
354
 	ce->fd=(int)fd;
355
 	ce->forward=0;
356
@@ -688,6 +534,4 @@
357
 	}
358
 	move=gc->head;
359
-#ifdef _LARGEFILE64_SOURCE 
360
-#ifdef __LP64__
361
 	while(move)
362
 	{
363
@@ -699,26 +543,4 @@
364
 		move=move->forward;
365
 	}
366
-#else
367
-	while(move)
368
-	{
369
-		if((move->fd == fd) && (move->myaiocb64.aio_offset==(off64_t)offset) &&
370
-			((size_t)size==move->myaiocb64.aio_nbytes))
371
-			{
372
-				return(move);
373
-			}
374
-		move=move->forward;
375
-	}
376
-#endif
377
-#else
378
-	while(move)
379
-	{
380
-		if((move->fd == fd) && (move->myaiocb.aio_offset==(off_t)offset) &&
381
-			((size_t)size==move->myaiocb.aio_nbytes))
382
-			{
383
-				return(move);
384
-			}
385
-		move=move->forward;
386
-	}
387
-#endif
388
 	return(0);
389
 }
390
@@ -805,24 +627,8 @@
391
 		if(ce==0)
392
 			return;
393
-#ifdef _LARGEFILE64_SOURCE 
394
-#ifdef __LP64__
395
-		while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
396
-#else
397
-		while((ret = aio_cancel64(0,&ce->myaiocb64))==AIO_NOTCANCELED)
398
-#endif
399
-#else
400
 		while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
401
-#endif
402
 			; 
403
 
404
-#ifdef _LARGEFILE64_SOURCE 
405
-#ifdef __LP64__
406
-		ret = aio_return(&ce->myaiocb);
407
-#else
408
-		ret = aio_return64(&ce->myaiocb64);
409
-#endif
410
-#else
411
 		ret = aio_return(&ce->myaiocb);
412
-#endif
413
 		ce->direct=0;
414
 		takeoff_cache(gc,ce);	  /* remove from cache */
415
@@ -865,98 +671,27 @@
416
 	if((ce=(struct cache_ent *)incache(gc,fd,offset,size)))
417
 	{
418
-#ifdef _LARGEFILE64_SOURCE 
419
-#ifdef __LP64__
420
 		while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
421
 		{
422
 			async_suspend(ce);
423
 		}
424
-#else
425
-		while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
426
-		{
427
-			async_suspend(ce);
428
-		}
429
-#endif
430
-#else
431
-		while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
432
-		{
433
-			async_suspend(ce);
434
-		}
435
-#endif
436
 		if(ret)
437
-			printf("aio_error 3: ret %d %d\n",ret,errno);
438
-#ifdef _LARGEFILE64_SOURCE 
439
-#ifdef __LP64__
440
-		if(ce->oldbuf != ce->myaiocb.aio_buf ||
441
-			ce->oldfd != ce->myaiocb.aio_fildes ||
442
-			ce->oldsize != ce->myaiocb.aio_nbytes) 
443
-#else
444
-		if(ce->oldbuf != ce->myaiocb64.aio_buf ||
445
-			ce->oldfd != ce->myaiocb64.aio_fildes ||
446
-			ce->oldsize != ce->myaiocb64.aio_nbytes) 
447
-#endif
448
-#else
449
-		if(ce->oldbuf != ce->myaiocb.aio_buf ||
450
-			ce->oldfd != ce->myaiocb.aio_fildes ||
451
-			ce->oldsize != ce->myaiocb.aio_nbytes) 
452
-#endif
453
+			printf("aio_error 3: ret %zd %d\n",ret,errno);
454
 			printf("It changed in flight\n");
455
 			
456
-#ifdef _LARGEFILE64_SOURCE 
457
-#ifdef __LP64__
458
-		retval=aio_return(&ce->myaiocb);
459
-#else
460
-		retval=aio_return64(&ce->myaiocb64);
461
-#endif
462
-#else
463
 		retval=aio_return(&ce->myaiocb);
464
-#endif
465
 		if(retval > 0)
466
 		{
467
-#ifdef _LARGEFILE64_SOURCE 
468
-#ifdef __LP64__
469
-			*ubuffer=(char *)ce->myaiocb.aio_buf;
470
-#else
471
-			*ubuffer=(char *)ce->myaiocb64.aio_buf;
472
-#endif
473
-#else
474
-			*ubuffer=(char *)ce->myaiocb.aio_buf;
475
-#endif
476
+			*ubuffer= (char *)ce->myaiocb.aio_buf;
477
 		}else
478
-			*ubuffer=0;
479
-#ifdef _LARGEFILE64_SOURCE 
480
-#ifdef __LP64__
481
-		if(retval < ce->myaiocb.aio_nbytes)
482
-#else
483
-		if(retval < ce->myaiocb64.aio_nbytes)
484
-#endif
485
-#else
486
+			*ubuffer= NULL;
487
 		if(retval < ce->myaiocb.aio_nbytes)
488
-#endif
489
 		{
490
-			printf("aio_return error4: ret %d %d\n",retval,errno);
491
-#ifdef _LARGEFILE64_SOURCE 
492
-#ifdef __LP64__
493
-			printf("aio_return error4: fd %d offset %lld buffer %lx size %d Opcode %d\n",
494
-				ce->myaiocb.aio_fildes,
495
-				ce->myaiocb.aio_offset,
496
-				(long)(ce->myaiocb.aio_buf),
497
-				ce->myaiocb.aio_nbytes,
498
-				ce->myaiocb.aio_lio_opcode
499
-#else
500
-			printf("aio_return error4: fd %d offset %lld buffer %lx size %d Opcode %d\n",
501
-				ce->myaiocb64.aio_fildes,
502
-				ce->myaiocb64.aio_offset,
503
-				(long)(ce->myaiocb64.aio_buf),
504
-				ce->myaiocb64.aio_nbytes,
505
-				ce->myaiocb64.aio_lio_opcode
506
-#endif
507
-#else
508
-			printf("aio_return error4: fd %d offset %d buffer %lx size %d Opcode %d\n",
509
+			printf("aio_return error4: ret %zd %d\n",retval,errno);
510
+			printf("aio_return error4: fd %d offset %lld buffer %p size %zd Opcode %d\n",
511
 				ce->myaiocb.aio_fildes,
512
-				ce->myaiocb.aio_offset,
513
-				(long)(ce->myaiocb.aio_buf),
514
+				(long long)ce->myaiocb.aio_offset,
515
+				ce->myaiocb.aio_buf,
516
 				ce->myaiocb.aio_nbytes,
517
 				ce->myaiocb.aio_lio_opcode
518
-#endif
519
 				);
520
 		}
521
@@ -974,22 +709,8 @@
522
 		/*printf("allocated buffer/read %x offset %d\n",first_ce->myaiocb.aio_buf,offset);*/
523
 again:
524
-#ifdef _LARGEFILE64_SOURCE 
525
-#ifdef __LP64__
526
-		first_ce->oldbuf=first_ce->myaiocb.aio_buf;
527
-		first_ce->oldfd=first_ce->myaiocb.aio_fildes;
528
-		first_ce->oldsize=first_ce->myaiocb.aio_nbytes;
529
-		ret=aio_read(&first_ce->myaiocb);
530
-#else
531
-		first_ce->oldbuf=first_ce->myaiocb64.aio_buf;
532
-		first_ce->oldfd=first_ce->myaiocb64.aio_fildes;
533
-		first_ce->oldsize=first_ce->myaiocb64.aio_nbytes;
534
-		ret=aio_read64(&first_ce->myaiocb64);
535
-#endif
536
-#else
537
 		first_ce->oldbuf=first_ce->myaiocb.aio_buf;
538
 		first_ce->oldfd=first_ce->myaiocb.aio_fildes;
539
 		first_ce->oldsize=first_ce->myaiocb.aio_nbytes;
540
 		ret=aio_read(&first_ce->myaiocb);
541
-#endif
542
 		if(ret!=0)
543
 		{
544
@@ -997,5 +718,5 @@
545
 				goto again;
546
 			else
547
-				printf("error returned from aio_read(). Ret %d errno %d\n",ret,errno);
548
+				printf("error returned from aio_read(). Ret %zd errno %d\n",ret,errno);
549
 		}
550
 	}
551
@@ -1022,22 +743,8 @@
552
 			continue;
553
 		ce=alloc_cache(gc,fd,r_offset,a_size,(long long)LIO_READ);
554
-#ifdef _LARGEFILE64_SOURCE 
555
-#ifdef __LP64__
556
-		ce->oldbuf=ce->myaiocb.aio_buf;
557
-		ce->oldfd=ce->myaiocb.aio_fildes;
558
-		ce->oldsize=ce->myaiocb.aio_nbytes;
559
-		ret=aio_read(&ce->myaiocb);
560
-#else
561
-		ce->oldbuf=ce->myaiocb64.aio_buf;
562
-		ce->oldfd=ce->myaiocb64.aio_fildes;
563
-		ce->oldsize=ce->myaiocb64.aio_nbytes;
564
-		ret=aio_read64(&ce->myaiocb64);
565
-#endif
566
-#else
567
 		ce->oldbuf=ce->myaiocb.aio_buf;
568
 		ce->oldfd=ce->myaiocb.aio_fildes;
569
 		ce->oldsize=ce->myaiocb.aio_nbytes;
570
 		ret=aio_read(&ce->myaiocb);
571
-#endif
572
 		if(ret!=0)
573
 		{
574
@@ -1049,39 +756,10 @@
575
 	if(del_read)	/* Wait for the first read to complete */
576
 	{
577
-#ifdef _LARGEFILE64_SOURCE 
578
-#ifdef __LP64__
579
 		while((ret=aio_error(&first_ce->myaiocb))== EINPROGRESS)
580
 		{
581
 			async_suspend(first_ce);
582
 		}
583
-#else
584
-		while((ret=aio_error64(&first_ce->myaiocb64))== EINPROGRESS)
585
-		{
586
-			async_suspend(first_ce);
587
-		}
588
-#endif
589
-#else
590
-		while((ret=aio_error(&first_ce->myaiocb))== EINPROGRESS)
591
-		{
592
-			async_suspend(first_ce);
593
-		}
594
-#endif
595
 		if(ret)
596
-			printf("aio_error 4: ret %d %d\n",ret,errno);
597
-#ifdef _LARGEFILE64_SOURCE 
598
-#ifdef __LP64__
599
-		if(first_ce->oldbuf != first_ce->myaiocb.aio_buf ||
600
-			first_ce->oldfd != first_ce->myaiocb.aio_fildes ||
601
-			first_ce->oldsize != first_ce->myaiocb.aio_nbytes) 
602
-			printf("It changed in flight2\n");
603
-		retval=aio_return(&first_ce->myaiocb);
604
-#else
605
-		if(first_ce->oldbuf != first_ce->myaiocb64.aio_buf ||
606
-			first_ce->oldfd != first_ce->myaiocb64.aio_fildes ||
607
-			first_ce->oldsize != first_ce->myaiocb64.aio_nbytes) 
608
-			printf("It changed in flight2\n");
609
-		retval=aio_return64(&first_ce->myaiocb64);
610
-#endif
611
-#else
612
+			printf("aio_error 4: ret %zd %d\n",ret,errno);
613
 		if(first_ce->oldbuf != first_ce->myaiocb.aio_buf ||
614
 			first_ce->oldfd != first_ce->myaiocb.aio_fildes ||
615
@@ -1089,55 +767,20 @@
616
 			printf("It changed in flight2\n");
617
 		retval=aio_return(&first_ce->myaiocb);
618
-#endif
619
-#ifdef _LARGEFILE64_SOURCE 
620
-#ifdef __LP64__
621
-		if(retval < first_ce->myaiocb.aio_nbytes)
622
-#else
623
-		if(retval < first_ce->myaiocb64.aio_nbytes)
624
-#endif
625
-#else
626
 		if(retval < first_ce->myaiocb.aio_nbytes)
627
-#endif
628
 		{
629
-			printf("aio_return error5: ret %d %d\n",retval,errno);
630
-#ifdef _LARGEFILE64_SOURCE 
631
-#ifdef __LP64__
632
-			printf("aio_return error5: fd %d offset %lld buffer %lx size %d Opcode %d\n",
633
-				first_ce->myaiocb.aio_fildes,
634
-				first_ce->myaiocb.aio_offset,
635
-				(long)(first_ce->myaiocb.aio_buf),
636
-				first_ce->myaiocb.aio_nbytes,
637
-				first_ce->myaiocb.aio_lio_opcode
638
-#else
639
-			printf("aio_return error5: fd %d offset %lld buffer %lx size %d Opcode %d\n",
640
-				first_ce->myaiocb64.aio_fildes,
641
-				first_ce->myaiocb64.aio_offset,
642
-				(long)(first_ce->myaiocb64.aio_buf),
643
-				first_ce->myaiocb64.aio_nbytes,
644
-				first_ce->myaiocb64.aio_lio_opcode
645
-#endif
646
-#else
647
-			printf("aio_return error5: fd %d offset %ld buffer %lx size %d Opcode %d\n",
648
+			printf("aio_return error5: ret %zd %d\n",retval,errno);
649
+			printf("aio_return error5: fd %d offset %lld buffer %p size %zd Opcode %d\n",
650
 				first_ce->myaiocb.aio_fildes,
651
-				first_ce->myaiocb.aio_offset,
652
-				(long)(first_ce->myaiocb.aio_buf),
653
+				(long long)first_ce->myaiocb.aio_offset,
654
+				first_ce->myaiocb.aio_buf,
655
 				first_ce->myaiocb.aio_nbytes,
656
 				first_ce->myaiocb.aio_lio_opcode
657
-#endif
658
 				);
659
 		}
660
 		if(retval > 0)
661
 		{
662
-#ifdef _LARGEFILE64_SOURCE 
663
-#ifdef __LP64__
664
-			*ubuffer=(char *)first_ce->myaiocb.aio_buf;
665
-#else
666
-			*ubuffer=(char *)first_ce->myaiocb64.aio_buf;
667
-#endif
668
-#else
669
-			*ubuffer=(char *)first_ce->myaiocb.aio_buf;
670
-#endif
671
+			*ubuffer= (char *)first_ce->myaiocb.aio_buf;
672
 		}else
673
-			*ubuffer=(char *)0;
674
+			*ubuffer= NULL;
675
 		first_ce->direct=1;	 /* do not delete the buffer */
676
 		takeoff_cache(gc,first_ce);
677
@@ -1218,30 +861,14 @@
678
 	ce=allocate_write_buffer(gc,fd,offset,size,(long long)LIO_WRITE,depth,0LL,(char *)0,(char *)0);
679
 	ce->direct=0;	 /* not direct. Lib supplies buffer and must free it */
680
-#ifdef _LARGEFILE64_SOURCE 
681
-#ifdef __LP64__
682
-	mbcopy(buffer,(char *)(ce->myaiocb.aio_buf),(size_t)size);
683
-#else
684
-	mbcopy(buffer,(char *)(ce->myaiocb64.aio_buf),(size_t)size);
685
-#endif
686
-#else
687
 	mbcopy(buffer,(char *)(ce->myaiocb.aio_buf),(size_t)size);
688
-#endif
689
 	async_put_on_write_queue(gc,ce);
690
 	/*
691
-	printf("asw: fd %d offset %lld, size %d\n",ce->myaiocb64.aio_fildes,
692
-		ce->myaiocb64.aio_offset,
693
-		ce->myaiocb64.aio_nbytes);
694
+	printf("asw: fd %d offset %lld, size %zd\n",ce->myaiocb.aio_fildes,
695
+		ce->myaiocb.aio_offset,
696
+		ce->myaiocb.aio_nbytes);
697
 	*/	
698
 
699
 again:
700
-#ifdef _LARGEFILE64_SOURCE 
701
-#ifdef __LP64__
702
-	ret=aio_write(&ce->myaiocb);
703
-#else
704
-	ret=aio_write64(&ce->myaiocb64);
705
-#endif
706
-#else
707
 	ret=aio_write(&ce->myaiocb);
708
-#endif
709
 	if(ret==-1)
710
 	{
711
@@ -1259,11 +886,11 @@
712
 		else
713
 		{
714
-			printf("Error in aio_write: ret %d errno %d count %lld\n",ret,errno,gc->w_count);
715
+			printf("Error in aio_write: ret %zd errno %d count %lld\n",ret,errno,gc->w_count);
716
 			/*
717
-			printf("aio_write_no_copy: fd %d buffer %x offset %lld size %d\n",
718
-				ce->myaiocb64.aio_fildes,
719
-				ce->myaiocb64.aio_buf,
720
-				ce->myaiocb64.aio_offset,
721
-				ce->myaiocb64.aio_nbytes);
722
+			printf("aio_write_no_copy: fd %d buffer %x offset %lld size %zd\n",
723
+				ce->myaiocb.aio_fildes,
724
+				ce->myaiocb.aio_buf,
725
+				ce->myaiocb.aio_offset,
726
+				ce->myaiocb.aio_nbytes);
727
 			*/
728
 			exit(177);
729
@@ -1289,5 +916,5 @@
730
 {
731
 	struct cache_ent *ce;
732
-	long temp;
733
+	intptr_t temp;
734
 	if(fd==0LL)
735
 	{
736
@@ -1304,44 +931,10 @@
737
 	}
738
 	bzero(ce,sizeof(struct cache_ent));
739
-#ifdef _LARGEFILE64_SOURCE 
740
-#ifdef __LP64__
741
-	ce->myaiocb.aio_fildes=(int)fd;
742
-	ce->myaiocb.aio_offset=(off64_t)offset;
743
-	if(!direct)
744
-	{
745
-		ce->real_address = (char *)malloc((size_t)(size+page_size));
746
-		temp=(long)ce->real_address;
747
-		temp = (temp+page_size) & ~(page_size-1);
748
-		ce->myaiocb.aio_buf=(volatile void *)temp;
749
-	}else
750
-	{
751
-		ce->myaiocb.aio_buf=(volatile void *)buffer;
752
-		ce->real_address=(char *)free_addr;
753
-	}
754
-	if(ce->myaiocb.aio_buf == 0)
755
-#else
756
-	ce->myaiocb64.aio_fildes=(int)fd;
757
-	ce->myaiocb64.aio_offset=(off64_t)offset;
758
-	if(!direct)
759
-	{
760
-		ce->real_address = (char *)malloc((size_t)(size+page_size));
761
-		temp=(long)ce->real_address;
762
-		temp = (temp+page_size) & ~(page_size-1);
763
-		ce->myaiocb64.aio_buf=(volatile void *)temp;
764
-	}
765
-	else
766
-	{
767
-		ce->myaiocb64.aio_buf=(volatile void *)buffer;
768
-		ce->real_address=(char *)free_addr;
769
-	}
770
-	if(ce->myaiocb64.aio_buf == 0)
771
-#endif
772
-#else
773
 	ce->myaiocb.aio_fildes=(int)fd;
774
 	ce->myaiocb.aio_offset=(off_t)offset;
775
 	if(!direct)
776
 	{
777
-		ce->real_address = (char *)malloc((size_t)(size+page_size));
778
-		temp=(long)ce->real_address;
779
+		ce->real_address = malloc((size_t)(size+page_size));
780
+		temp = (intptr_t)ce->real_address;
781
 		temp = (temp+page_size) & ~(page_size-1);
782
 		ce->myaiocb.aio_buf=(volatile void *)temp;
783
@@ -1353,27 +946,12 @@
784
 	}
785
 	if(ce->myaiocb.aio_buf == 0)
786
-#endif
787
 	{
788
 		printf("Malloc failed 2\n");
789
 		exit(180);
790
 	}
791
-#ifdef _LARGEFILE64_SOURCE 
792
-#ifdef __LP64__
793
-	ce->myaiocb.aio_reqprio=0;
794
-	ce->myaiocb.aio_nbytes=(size_t)size;
795
-	ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
796
-	ce->myaiocb.aio_lio_opcode=(int)op;
797
-#else
798
-	ce->myaiocb64.aio_reqprio=0;
799
-	ce->myaiocb64.aio_nbytes=(size_t)size;
800
-	ce->myaiocb64.aio_sigevent.sigev_notify=SIGEV_NONE;
801
-	ce->myaiocb64.aio_lio_opcode=(int)op;
802
-#endif
803
-#else
804
 	ce->myaiocb.aio_reqprio=0;
805
 	ce->myaiocb.aio_nbytes=(size_t)size;
806
 	ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
807
 	ce->myaiocb.aio_lio_opcode=(int)op;
808
-#endif
809
 	ce->fd=(int)fd;
810
 	return(ce);
811
@@ -1409,5 +987,5 @@
812
 	while(gc->w_head)
813
 	{
814
-		/*printf("async_write_finish: Waiting for buffer %x to finish\n",gc->w_head->myaiocb64.aio_buf);*/
815
+		/*printf("async_write_finish: Waiting for buffer %x to finish\n",gc->w_head->myaiocb.aio_buf);*/
816
 		async_wait_for_write(gc);
817
 	}
818
@@ -1423,5 +1001,6 @@
819
 {
820
 	struct cache_ent *ce;
821
-	size_t ret,retval;
822
+	size_t ret;
823
+	int retval;
824
 	if(gc->w_head==0)
825
 		return;
826
@@ -1432,67 +1011,26 @@
827
 	if(ce==gc->w_tail)
828
 		gc->w_tail=0;
829
-	/*printf("Wait for buffer %x  offset %lld  size %d to finish\n",
830
-		ce->myaiocb64.aio_buf,
831
-		ce->myaiocb64.aio_offset,
832
-		ce->myaiocb64.aio_nbytes);
833
+	/*printf("Wait for buffer %x  offset %lld  size %zd to finish\n",
834
+		ce->myaiocb.aio_buf,
835
+		ce->myaiocb.aio_offset,
836
+		ce->myaiocb.aio_nbytes);
837
 	printf("write count %lld \n",gc->w_count);
838
 	*/
839
-#ifdef _LARGEFILE64_SOURCE 
840
-#ifdef __LP64__
841
-	while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
842
-	{
843
-		async_suspend(ce);
844
-	}
845
-#else
846
-	while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
847
-	{
848
-		async_suspend(ce);
849
-	}
850
-#endif
851
-#else
852
 	while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
853
 	{
854
 		async_suspend(ce);
855
 	}
856
-#endif
857
 	if(ret)
858
 	{
859
-		printf("aio_error 5: ret %d %d\n",ret,errno);
860
-#ifdef _LARGEFILE64_SOURCE 
861
-#ifdef __LP64__
862
-		printf("fd %d offset %lld size %d\n",
863
-			ce->myaiocb.aio_fildes,
864
-			ce->myaiocb.aio_offset,
865
-			ce->myaiocb.aio_nbytes);
866
-#else
867
-		printf("fd %d offset %lld size %d\n",
868
-			ce->myaiocb64.aio_fildes,
869
-			ce->myaiocb64.aio_offset,
870
-			ce->myaiocb64.aio_nbytes);
871
-#endif
872
-#else
873
-		printf("fd %d offset %lld size %d\n",
874
+		printf("aio_error 5: ret %zd %d\n",ret,errno);
875
+		printf("fd %d offset %lld size %zd\n",
876
 			ce->myaiocb.aio_fildes,
877
-			ce->myaiocb.aio_offset,
878
+			(long long)ce->myaiocb.aio_offset,
879
 			ce->myaiocb.aio_nbytes);
880
-#endif
881
 		exit(181);
882
 	}
883
 
884
-#ifdef _LARGEFILE64_SOURCE 
885
-#ifdef __LP64__
886
-	retval=aio_return(&ce->myaiocb);
887
-#else
888
-#if defined(__CrayX1__)
889
-	retval=aio_return64((aiocb64_t *)&ce->myaiocb64);
890
-#else
891
-	retval=aio_return64((struct aiocb64 *)&ce->myaiocb64);
892
-#endif
893
-
894
-#endif
895
-#else
896
 	retval=aio_return(&ce->myaiocb);
897
-#endif
898
-	if((int)retval < 0)
899
+	if(retval < 0)
900
 	{
901
 		printf("aio_return error: %d\n",errno);
902
@@ -1534,19 +1072,11 @@
903
 	async_put_on_write_queue(gc,ce);
904
 	/*
905
-	printf("awnc: fd %d offset %lld, size %d\n",ce->myaiocb64.aio_fildes,
906
-		ce->myaiocb64.aio_offset,
907
-		ce->myaiocb64.aio_nbytes);
908
+	printf("awnc: fd %d offset %lld, size %zd\n",ce->myaiocb.aio_fildes,
909
+		ce->myaiocb.aio_offset,
910
+		ce->myaiocb.aio_nbytes);
911
 	*/
912
 
913
 again:
914
-#ifdef _LARGEFILE64_SOURCE 
915
-#ifdef __LP64__
916
-	ret=aio_write(&ce->myaiocb);
917
-#else
918
-	ret=aio_write64(&ce->myaiocb64);
919
-#endif
920
-#else
921
 	ret=aio_write(&ce->myaiocb);
922
-#endif
923
 	if(ret==-1)
924
 	{
925
@@ -1564,26 +1094,10 @@
926
 		else
927
 		{
928
-			printf("Error in aio_write: ret %d errno %d\n",ret,errno);
929
-#ifdef _LARGEFILE64_SOURCE 
930
-#ifdef __LP64__
931
-			printf("aio_write_no_copy: fd %d buffer %lx offset %lld size %d\n",
932
-				ce->myaiocb.aio_fildes,
933
-				(long)(ce->myaiocb.aio_buf),
934
-				ce->myaiocb.aio_offset,
935
-				ce->myaiocb.aio_nbytes);
936
-#else
937
-			printf("aio_write_no_copy: fd %d buffer %lx offset %lld size %d\n",
938
-				ce->myaiocb64.aio_fildes,
939
-				(long)(ce->myaiocb64.aio_buf),
940
-				ce->myaiocb64.aio_offset,
941
-				ce->myaiocb64.aio_nbytes);
942
-#endif
943
-#else
944
-			printf("aio_write_no_copy: fd %d buffer %lx offset %ld size %d\n",
945
+			printf("Error in aio_write: ret %zd errno %d\n",ret,errno);
946
+			printf("aio_write_no_copy: fd %d buffer %p offset %lld size %zd\n",
947
 				ce->myaiocb.aio_fildes,
948
-				(long)(ce->myaiocb.aio_buf),
949
-				ce->myaiocb.aio_offset,
950
+				ce->myaiocb.aio_buf,
951
+				(long long)ce->myaiocb.aio_offset,
952
 				ce->myaiocb.aio_nbytes);
953
-#endif
954
 			exit(182);
955
 		}
956
@@ -1596,5 +1110,6 @@
957
 
958
 void mbcopy(source, dest, len)
959
-char *source,*dest;
960
+const char *source;
961
+char *dest;
962
 size_t len;
963
 {
(-)files/patch-pit_server.c (-34 lines)
Lines 6-42 Link Here
6
-	exit;
6
-	exit;
7
    }
7
    }
8
    /*
8
    /*
9
@@ -311,6 +310,6 @@
10
                   "   ai_socktype  = %d (SOCK_STREAM = %d, SOCK_DGRAM = %d)\n"
11
                   "   ai_protocol  = %d (IPPROTO_TCP = %d, IPPROTO_UDP = %d)\n"
12
-                  "   ai_addrlen   = %d (sockaddr_in = %lu, "
13
-                  "sockaddr_in6 = %lu)\n",
14
+                  "   ai_addrlen   = %d (sockaddr_in = %zu, "
15
+                  "sockaddr_in6 = %zu)\n",
16
                   ai->ai_flags,
17
                   ai->ai_family,
18
@@ -621,6 +620,6 @@
19
                         "Sockaddr info for new TCP client:\n"
20
                         "   sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
21
-                        "   addr len  = %d (sockaddr_in = %lu, "
22
-                        "sockaddr_in6 = %lu)\n",
23
+                        "   addr len  = %d (sockaddr_in = %zu, "
24
+                        "sockaddr_in6 = %zu)\n",
25
                         sadr->sa_family,
26
                         AF_INET,
27
@@ -729,5 +728,5 @@
28
                ssize_t rBytes = count;
29
                fprintf( stderr,
30
-                        "%s: UDP datagram received (%ld bytes).\n",
31
+                        "%s: UDP datagram received (%zd bytes).\n",
32
                         pgmName,
33
                         count );
34
@@ -746,6 +745,6 @@
35
                         "Remote client's sockaddr info:\n"
36
                         "   sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
37
-                        "   addr len  = %d (sockaddr_in = %lu, "
38
-                        "sockaddr_in6 = %lu)\n",
39
+                        "   addr len  = %d (sockaddr_in = %zu, "
40
+                        "sockaddr_in6 = %zu)\n",
41
                         sadr->sa_family,
42
                         AF_INET,

Return to bug 211152