1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-06 11:41:52 +00:00

Update iozone to build on HEAD and take maintainership

Sponsored by:	iXsystems
This commit is contained in:
Josh Paetzel 2016-07-20 15:36:05 +00:00
parent e50dc2a336
commit f0c5c928bf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=418841
4 changed files with 687 additions and 144 deletions

View File

@ -3,11 +3,12 @@
PORTNAME= iozone
DISTVERSION= 3_434
PORTREVISION= 1
CATEGORIES= benchmarks
MASTER_SITES= http://www.iozone.org/src/current/
DISTNAME= ${PORTNAME}${DISTVERSION}
MAINTAINER= ports@FreeBSD.org
MAINTAINER= jpaetzel@FreeBSD.org
COMMENT= Performance Test of Sequential File I/O
WRKSRC= ${WRKDIR}/${DISTNAME}/src/current

View File

@ -1,38 +1,462 @@
Fix warnings from modern compilers -- formats, use of 0 instead of NULL.
Also remove redundant casts and fix printf-formatting.
-mi
--- iozone.c 2015-10-20 14:12:13.000000000 +0000
--- iozone.c.orig 2015-10-20 14:12:13 UTC
+++ iozone.c
@@ -8679,5 +8679,5 @@
@@ -360,7 +360,7 @@ typedef off_t off64_t;
#ifndef SCO_Unixware_gcc
#ifndef UWIN
#ifndef __DragonFly__
-typedef long long off64_t;
+typedef long off64_t;
#endif
#endif
#endif
@@ -1918,7 +1918,7 @@ char **argv;
#ifdef NO_PRINT_LLD
sscanf(optarg,"%ld",&kilobytes64);
#else
- sscanf(optarg,"%lld",&kilobytes64);
+ sscanf(optarg,"%ld",&kilobytes64);
#endif
if(optarg[strlen(optarg)-1]=='k' ||
optarg[strlen(optarg)-1]=='K'){
@@ -1942,7 +1942,7 @@ char **argv;
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tFile size set to %ld kB\n",kilobytes64);
#else
- sprintf(splash[splash_line++],"\tFile size set to %lld kB\n",kilobytes64);
+ sprintf(splash[splash_line++],"\tFile size set to %ld kB\n",kilobytes64);
#endif
sflag++;
break;
@@ -2316,7 +2316,7 @@ char **argv;
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tUsing minimum file size of %ld kilobytes.\n",minimum_file_size);
#else
- sprintf(splash[splash_line++],"\tUsing minimum file size of %lld kilobytes.\n",minimum_file_size);
+ sprintf(splash[splash_line++],"\tUsing minimum file size of %ld kilobytes.\n",minimum_file_size);
#endif
break;
case 'g': /* Set maximum file size for auto mode */
@@ -2339,7 +2339,7 @@ char **argv;
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tUsing maximum file size of %ld kilobytes.\n",maximum_file_size);
#else
- sprintf(splash[splash_line++],"\tUsing maximum file size of %lld kilobytes.\n",maximum_file_size);
+ sprintf(splash[splash_line++],"\tUsing maximum file size of %ld kilobytes.\n",maximum_file_size);
#endif
break;
case 'z': /* Set no cross over */
@@ -2447,7 +2447,7 @@ char **argv;
#ifdef NO_PRINT_LLD
sscanf(subarg,"%ld",&burst_size_kb_64);
#else
- sscanf(subarg,"%lld",&burst_size_kb_64);
+ sscanf(subarg,"%ld",&burst_size_kb_64);
#endif
if(subarg[strlen(subarg)-1]=='k' ||
subarg[strlen(subarg)-1]=='K'){
@@ -3108,7 +3108,7 @@ char **argv;
printf("\tBurst size set to %ld Kbytes.\n\tBurst sleep duration set to %ld msec\n",
burst_size_kb_64, burst_sleep_duration_msec);
#else
- printf("\tBurst size set to %lld Kbytes.\n\tBurst sleep duration set to %lld msec\n",
+ printf("\tBurst size set to %ld Kbytes.\n\tBurst sleep duration set to %lld msec\n",
burst_size_kb_64, burst_sleep_duration_msec);
#endif
if(!rflag)
@@ -3345,7 +3345,7 @@ long long reclength;
if(!silent) printf("%8ld",reclen/1024);
}
#else
- if(!silent) printf("%16lld",kilobytes64);
+ if(!silent) printf("%16ld",kilobytes64);
if(r_traj_flag || w_traj_flag)
{
if(!silent) printf("%8lld",(long long )0);
@@ -3403,7 +3403,7 @@ long long reclength;
printf("\n\tiozone %ld %ld ", kilobytes64, goodrecl);
printf("\t(i.e. record size = %ld bytes)\n", goodrecl);
#else
- printf("\n\tiozone %lld %lld ", kilobytes64, goodrecl);
+ printf("\n\tiozone %ld %lld ", kilobytes64, goodrecl);
printf("\t(i.e. record size = %lld bytes)\n", goodrecl);
#endif
}
@@ -3543,7 +3543,7 @@ void auto_test()
printf("Error: record length %ld is greater than filesize %ld kB\n ",
min_rec_size,min_file_size);
#else
- printf("Error: record length %lld is greater than filesize %lld kB\n ",
+ printf("Error: record length %lld is greater than filesize %ld kB\n ",
min_rec_size,min_file_size);
#endif
exit(23);
@@ -3738,7 +3738,7 @@ throughput_test()
if(!silent) printf("\tEach %s writes a %ld kByte file in telemetry controlled records\n",
port,kilobytes64);
#else
- if(!silent) printf("\tEach %s writes a %lld kByte file in telemetry controlled records\n",
+ if(!silent) printf("\tEach %s writes a %ld kByte file in telemetry controlled records\n",
port,kilobytes64);
#endif
}
@@ -3748,7 +3748,7 @@ throughput_test()
if(!silent) printf("\tEach %s writes a %ld kByte file in %ld kbyte records\n",
port,kilobytes64,reclen/1024);
#else
- if(!silent) printf("\tEach %s writes a %lld kByte file in %lld kByte records\n",
+ if(!silent) printf("\tEach %s writes a %ld kByte file in %lld kByte records\n",
port,kilobytes64,reclen/1024);
#endif
}
@@ -7182,8 +7182,8 @@ char sverify;
printf("where %8.8lx loop %ld\n",where,i);
#else
printf("Error in file: Found ?%llx? Expecting ?%llx? addr %lx\n",*where, (long long)((pattern_buf<<32)|pattern_buf),((long)where));
- printf("Error in file: Position %lld \n",file_position);
- printf("Record # %lld Record size %lld kb \n",recnum,recsize/1024);
+ printf("Error in file: Position %ld \n",file_position);
+ printf("Record # %ld Record size %lld kb \n",recnum,recsize/1024);
printf("where %px loop %lld\n",where,(long long)i);
#endif
return(1);
@@ -7226,9 +7226,9 @@ char sverify;
printf("Error in file: Position %ld \n",file_position);
printf("Record # %ld Record size %ld kb \n",recnum,recsize/1024);
#else
- printf("Error in file: Position %lld %lld %lld \n",i,j,k);
- printf("Error in file: Position %lld \n",file_position);
- printf("Record # %lld Record size %lld kb \n",recnum,recsize/1024);
+ printf("Error in file: Position %ld %lld %lld \n",i,j,k);
+ printf("Error in file: Position %ld \n",file_position);
+ printf("Record # %ld Record size %lld kb \n",recnum,recsize/1024);
#endif
printf("Found pattern: Char >>%c<< Expecting >>%c<<\n", *where2,*pattern_ptr);
printf("Found pattern: Hex >>%x<< Expecting >>%x<<\n", *where2,*pattern_ptr);
@@ -7835,9 +7835,9 @@ long long *data2;
else
fprintf(rwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
#else
- fprintf(wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
+ fprintf(wqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
else
- fprintf(rwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
+ fprintf(rwqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((qtime_stop-qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;
@@ -8331,7 +8331,7 @@ long long *data1,*data2;
printf("\nError freading block %lu %lx\n", i,
(unsigned long long)buffer);
#else
- printf("\nError freading block %llu %llx\n", i,
+ printf("\nError freading block %ld %llx\n", i,
(unsigned long long)buffer);
#endif
#else
@@ -8678,7 +8678,7 @@ long long *data1,*data2;
}
if(r_traj_flag)
{
- traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&compute_time, (long)0);
+ traj_offset=get_traj(r_traj_fd, &traj_size, &compute_time, 0);
reclen=traj_size;
#if defined(Windows)
@@ -14765,5 +14765,5 @@
if(unbuffered)
@@ -8749,7 +8749,7 @@ long long *data1,*data2;
printf("\nError reading block %ld %lx\n", i,
(unsigned long long)nbuff);
#else
- printf("\nError reading block %lld %llx\n", i,
+ printf("\nError reading block %ld %llx\n", i,
(unsigned long long)nbuff);
#endif
#else
@@ -8798,9 +8798,9 @@ long long *data1,*data2;
else
fprintf(rrqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
#else
- fprintf(rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
+ fprintf(rqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
else
- fprintf(rrqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
+ fprintf(rrqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,(qtime_stop-qtime_start-time_res)*1000000,reclen);
#endif
}
r_traj_ops_completed++;
@@ -9226,7 +9226,7 @@ long long *data1, *data2;
printf("\nError reading block at %ld\n",
offset64);
#else
- printf("\nError reading block at %lld\n",
+ printf("\nError reading block at %ld\n",
offset64);
#endif
perror("read");
@@ -9350,7 +9350,7 @@ long long *data1, *data2;
printf("\nError writing block at %ld\n",
offset64);
#else
- printf("\nError writing block at %lld\n",
+ printf("\nError writing block at %ld\n",
offset64);
#endif
if(wval==-1)
@@ -9667,7 +9667,7 @@ long long *data1,*data2;
#ifdef NO_PRINT_LLD
printf("\nError reading block %ld\n", i);
#else
- printf("\nError reading block %lld\n", i);
+ printf("\nError reading block %ld\n", i);
#endif
perror("read");
exit(79);
@@ -10272,8 +10272,8 @@ long long *data1, *data2;
printf("\nError reading block %ld, fd= %d Filename %s Read returned %ld\n", i, fd,filename,uu);
printf("\nSeeked to %ld Reclen = %ld\n", savepos64,reclen);
#else
- printf("\nError reading block %lld, fd= %d Filename %s Read returned %lld\n", i, fd,filename,uu);
- printf("\nSeeked to %lld Reclen = %lld\n", savepos64,reclen);
+ printf("\nError reading block %ld, fd= %d Filename %s Read returned %lld\n", i, fd,filename,uu);
+ printf("\nSeeked to %ld Reclen = %lld\n", savepos64,reclen);
#endif
perror("read");
exit(88);
@@ -11799,7 +11799,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#else
- if(!silent) printf(" %c%lld%c",'"',rec_size/1024,'"');
+ if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#endif
}
if(!silent) printf("\n");
@@ -11817,7 +11817,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
- if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
+ if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#endif
for(i=0;i<=max_y;i++){
if(report_array[0][i] != current_file_size){
@@ -11832,7 +11832,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
- if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
+ if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#endif
}
if(bif_flag)
@@ -11840,7 +11840,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf(" %ld ",report_array[who][i]);
#else
- if(!silent) printf(" %lld ",report_array[who][i]);
+ if(!silent) printf(" %ld ",report_array[who][i]);
#endif
}
if(bif_flag)
@@ -12029,7 +12029,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#else
- if(!silent) printf(" %c%lld%c",'"',rec_size/1024,'"');
+ if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#endif
}
if(!silent) printf("\n");
@@ -12047,7 +12047,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
- if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
+ if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#endif
for (i = 0; i <= max_y; i++) {
if (report_array[0][i] != current_file_size) {
@@ -12062,7 +12062,7 @@ long long who;
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
- if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
+ if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#endif
}
if (bif_flag)
@@ -13061,7 +13061,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_wqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;
@@ -13715,7 +13715,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_wqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;
@@ -14325,7 +14325,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_rwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_rwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_rwqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
if(rlocking)
@@ -14764,7 +14764,7 @@ thread_read_test(x)
}
if(r_traj_flag)
{
- traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
+ traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
reclen=traj_size;
#if defined(Windows)
@@ -15318,5 +15318,5 @@
if(unbuffered)
@@ -14840,7 +14840,7 @@ thread_read_test(x)
printf("\nError reading block %ld, fd= %d\n", i,
fd);
#else
- printf("\nError reading block %lld, fd= %d\n", i,
+ printf("\nError reading block %ld, fd= %d\n", i,
fd);
#endif
perror("read");
@@ -14914,7 +14914,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_rqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_rqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
@@ -15317,7 +15317,7 @@ thread_pread_test(x)
}
if(r_traj_flag)
{
- traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
+ traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
reclen=traj_size;
I_LSEEK(fd,traj_offset,SEEK_SET);
@@ -15878,5 +15878,5 @@
}
@@ -15375,7 +15375,7 @@ thread_pread_test(x)
printf("\nError preading block %ld, fd= %d\n", i,
fd);
#else
- printf("\nError preading block %lld, fd= %d\n", i,
+ printf("\nError preading block %ld, fd= %d\n", i,
fd);
#endif
perror("pread");
@@ -15449,7 +15449,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_rqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_rqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_rqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
@@ -15877,7 +15877,7 @@ thread_rread_test(x)
}
if(r_traj_flag)
{
- traj_offset=get_traj(r_traj_fd, (long long *)&traj_size,(float *)&delay,(long)0);
+ traj_offset=get_traj(r_traj_fd, &traj_size, &delay, 0);
reclen=traj_size;
#if defined(Windows)
@@ -18745,11 +18745,5 @@
if(unbuffered)
@@ -15953,7 +15953,7 @@ thread_rread_test(x)
printf("\nError writing block %ld, fd= %d\n", i,
fd);
#else
- printf("\nError writing block %lld, fd= %d\n", i,
+ printf("\nError writing block %ld, fd= %d\n", i,
fd);
#endif
perror("read");
@@ -16027,7 +16027,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_rrqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_rrqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_rrqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
@@ -16503,7 +16503,7 @@ thread_reverse_read_test(x)
#ifdef NO_PRINT_LLD
printf("\nError reading block %ld\n", i);
#else
- printf("\nError reading block %lld\n", i);
+ printf("\nError reading block %ld\n", i);
#endif
perror("read");
if (!no_unlink)
@@ -16585,7 +16585,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_revqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_revqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_revqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
}
@@ -17013,7 +17013,7 @@ thread_stride_read_test(x)
#ifdef NO_PRINT_LLD
printf("\nError reading block %ld, fd= %d\n", i, fd);
#else
- printf("\nError reading block %lld, fd= %d\n", i, fd);
+ printf("\nError reading block %ld, fd= %d\n", i, fd);
#endif
perror("read");
if (!no_unlink)
@@ -17130,7 +17130,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_strqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_strqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_strqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
}
@@ -17736,7 +17736,7 @@ thread_ranread_test(x)
printf("\nError reading block at %ld\n",
offset);
#else
- printf("\nError reading block at %lld\n",
+ printf("\nError reading block at %ld\n",
offset);
#endif
perror("ranread");
@@ -17814,7 +17814,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_randrfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_randrfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_randrfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
}
@@ -18492,7 +18492,7 @@ printf("Desired rate %g Actual rate %g
#ifdef NO_PRINT_LLD
fprintf(thread_randwqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_randwqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_randwqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;
@@ -18744,13 +18744,7 @@ void *x;
pthread_attr_t attr;
int xx;
int *yy;
-#ifdef _64BIT_ARCH_
@ -45,7 +469,9 @@ Also remove redundant casts and fix printf-formatting.
+ intptr_t meme = (intptr_t)x;
yy=(int *)x;
@@ -18770,6 +18764,6 @@
@@ -18769,8 +18763,8 @@ void *x;
printf("Thread create failed. Returned %d Errno = %d\n",xx,errno);
if(debug1 )
{
- printf("\nthread created has an id of %lx\n",ts);
@ -54,101 +480,157 @@ Also remove redundant casts and fix printf-formatting.
+ printf("meme %lld\n", (long long)meme);
}
return((long long)meme);
@@ -22167,5 +22161,5 @@
}
@@ -22166,7 +22160,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_write_test\n",(int)chid);
fflush(newstdout);
}
- thread_write_test((long)0);
+ thread_write_test(NULL);
break;
#ifdef HAVE_PREAD
@@ -22176,5 +22170,5 @@
case THREAD_PWRITE_TEST :
@@ -22175,7 +22169,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_pwrite_test\n",(int)chid);
fflush(newstdout);
}
- thread_pwrite_test((long)0);
+ thread_pwrite_test(NULL);
break;
#endif
@@ -22185,5 +22179,5 @@
case THREAD_REWRITE_TEST :
@@ -22184,7 +22178,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_rewrite_test\n",(int)chid);
fflush(newstdout);
}
- thread_rwrite_test((long)0);
+ thread_rwrite_test(NULL);
break;
case THREAD_READ_TEST :
@@ -22193,5 +22187,5 @@
if(cdebug>=1)
@@ -22192,7 +22186,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
fflush(newstdout);
}
- thread_read_test((long)0);
+ thread_read_test(NULL);
break;
#ifdef HAVE_PREAD
@@ -22202,5 +22196,5 @@
case THREAD_PREAD_TEST :
@@ -22201,7 +22195,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
fflush(newstdout);
}
- thread_pread_test((long)0);
+ thread_pread_test(NULL);
break;
#endif
@@ -22211,5 +22205,5 @@
case THREAD_REREAD_TEST :
@@ -22210,7 +22204,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_reread_test\n",(int)chid);
fflush(newstdout);
}
- thread_rread_test((long)0);
+ thread_rread_test(NULL);
break;
case THREAD_STRIDE_TEST :
@@ -22219,5 +22213,5 @@
if(cdebug>=1)
@@ -22218,7 +22212,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_stride_read_test\n",(int)chid);
fflush(newstdout);
}
- thread_stride_read_test((long)0);
+ thread_stride_read_test(NULL);
break;
case THREAD_RANDOM_READ_TEST :
@@ -22227,5 +22221,5 @@
if(cdebug>=1)
@@ -22226,7 +22220,7 @@ become_client()
fprintf(newstdout,"Child %d running random read test\n",(int)chid);
fflush(newstdout);
}
- thread_ranread_test((long)0);
+ thread_ranread_test(NULL);
break;
case THREAD_RANDOM_WRITE_TEST :
@@ -22235,5 +22229,5 @@
if(cdebug>=1)
@@ -22234,7 +22228,7 @@ become_client()
fprintf(newstdout,"Child %d running random write test\n",(int)chid);
fflush(newstdout);
}
- thread_ranwrite_test((long)0);
+ thread_ranwrite_test(NULL);
break;
case THREAD_REVERSE_READ_TEST :
@@ -22243,5 +22237,5 @@
if(cdebug>=1)
@@ -22242,7 +22236,7 @@ become_client()
fprintf(newstdout,"Child %d running reverse read test\n",(int)chid);
fflush(newstdout);
}
- thread_reverse_read_test((long)0);
+ thread_reverse_read_test(NULL);
break;
case THREAD_RANDOM_MIX_TEST :
@@ -22251,5 +22245,5 @@
if(cdebug>=1)
@@ -22250,7 +22244,7 @@ become_client()
fprintf(newstdout,"Child %d running mixed workload test\n",(int)chid);
fflush(newstdout);
}
- thread_mix_test((long)0);
+ thread_mix_test(NULL);
break;
case THREAD_FWRITE_TEST :
@@ -22259,5 +22253,5 @@
if(cdebug>=1)
@@ -22258,7 +22252,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_fwrite_test\n",(int)chid);
fflush(newstdout);
}
- thread_fwrite_test((long)0);
+ thread_fwrite_test(NULL);
break;
case THREAD_FREAD_TEST :
@@ -22267,5 +22261,5 @@
if(cdebug>=1)
@@ -22266,7 +22260,7 @@ become_client()
fprintf(newstdout,"Child %d running thread_fread_test\n",(int)chid);
fflush(newstdout);
}
- thread_fread_test((long)0);
+ thread_fread_test(NULL);
break;
case THREAD_CLEANUP_TEST :
@@ -22275,5 +22269,5 @@
if(cdebug>=1)
@@ -22274,7 +22268,7 @@ become_client()
fprintf(newstdout,"Child %d running cleanup\n",(int)chid);
fflush(newstdout);
}
- thread_cleanup_test((long)0);
+ thread_cleanup_test(NULL);
break;
};
if(cdebug>=1)
@@ -23009,7 +23003,7 @@ char *shell;
#ifdef _HPUX_SOURCE
strcpy(shell,"remsh");
#else
- strcpy(shell,"rsh");
+ strcpy(shell,"ssh");
#endif
return;
}
@@ -25030,7 +25024,7 @@ void * thread_fwrite_test( x)
#ifdef NO_PRINT_LLD
fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_wqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;
@@ -25489,7 +25483,7 @@ void * thread_fread_test( x)
#ifdef NO_PRINT_LLD
fprintf(thread_wqfd,"%10.1ld %10.0f %10.1ld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#else
- fprintf(thread_wqfd,"%10.1lld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
+ fprintf(thread_wqfd,"%10.1ld %10.0f %10.1lld\n",(traj_offset)/1024,((thread_qtime_stop-thread_qtime_start-time_res))*1000000,reclen);
#endif
}
w_traj_ops_completed++;

View File

@ -1,14 +1,7 @@
The bulk of this patch eliminates the gratutious differences between
LP64, LARGEFILE64 and normal cases. The differences are dealt with
in one location and the rest of the code need not differ.
Most of the other changes deal with printf-formats (%zd for ssize_t
and the like) and other warnings.
-mi
--- libasync.c 2015-10-20 14:12:13.000000000 +0000
--- libasync.c.orig 2015-10-20 14:12:13 UTC
+++ libasync.c
@@ -97,4 +97,13 @@
@@ -96,6 +96,15 @@
#include <sys/types.h>
#include <aio.h>
+
@ -22,7 +15,9 @@ and the like) and other warnings.
+
#if defined(solaris) || defined(linux) || defined(SCO_Unixware_gcc) || defined(__NetBSD__)
#else
@@ -133,9 +142,13 @@
#include <sys/timers.h>
@@ -132,11 +141,15 @@
#include <strings.h> /* For the BSD string functions */
#endif
-void mbcopy(char *source, char *dest, size_t len);
@ -37,7 +32,9 @@ and the like) and other warnings.
+# endif
#endif
#if defined(OSFV5)
@@ -151,13 +164,14 @@
#include <string.h>
@@ -150,15 +163,16 @@ extern int one;
* cache, pointed to by async_init(gc) will be of
* this structure type.
*/
-char version[] = "Libasync Version $Revision: 3.25 $";
@ -57,7 +54,9 @@ and the like) and other warnings.
+ struct aiocb myaiocb;
#endif
long long fd; /* File descriptor */
@@ -192,6 +205,6 @@
long long size; /* Size of the transfer */
@@ -191,8 +205,8 @@ struct cache {
long long max_depth;
extern int errno;
-struct cache_ent *alloc_cache();
@ -66,22 +65,26 @@ and the like) and other warnings.
+static struct cache_ent *incache();
void async_init();
void end_async();
@@ -275,5 +288,5 @@
int async_suspend();
@@ -274,7 +288,7 @@ async_suspend(struct cache_ent *ce)
#ifdef __LP64__
const struct aiocb * const cblist[1] = {&ce->myaiocb};
#else
- const struct aiocb64 * const cblist[1] = {&ce->myaiocb64};
+ const struct aiocb64 * const cblist[1] = {&ce->myaiocb};
#endif
#else
@@ -348,87 +361,26 @@
const struct aiocb * const cblist[1] = {&ce->myaiocb};
@@ -347,89 +361,28 @@ long long depth;
*/
if((ce=(struct cache_ent *)incache(gc,fd,offset,size)))
{
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
-#else
- while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
- {
@ -89,10 +92,10 @@ and the like) and other warnings.
- }
-#endif
-#else
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
-#endif
if(ret)
{
@ -117,12 +120,12 @@ and the like) and other warnings.
{
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
- mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
-#else
- mbcopy((char *)ce->myaiocb64.aio_buf,(char *)ubuffer,(size_t)retval);
-#endif
-#else
- mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
mbcopy((char *)ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
-#endif
}
-#ifdef _LARGEFILE64_SOURCE
@ -166,28 +169,32 @@ and the like) and other warnings.
-#endif
);
}
@@ -444,13 +396,5 @@
ce->direct=0;
@@ -443,21 +396,13 @@ long long depth;
del_read++;
first_ce=alloc_cache(gc,fd,offset,size,(long long)LIO_READ);
again:
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
ret=aio_read(&first_ce->myaiocb);
- ret=aio_read(&first_ce->myaiocb);
-#else
- ret=aio_read64(&first_ce->myaiocb64);
-#endif
-#else
- ret=aio_read(&first_ce->myaiocb);
ret=aio_read(&first_ce->myaiocb);
-#endif
if(ret!=0)
{
@@ -458,5 +402,5 @@
if(errno==EAGAIN)
goto again;
else
- printf("error returned from aio_read(). Ret %d errno %d\n",ret,errno);
+ printf("error returned from aio_read(). Ret %zd errno %d\n",ret,errno);
}
}
@@ -483,13 +427,5 @@
if(stride==0) /* User does not want read-ahead */
@@ -482,15 +427,7 @@ again:
if((ce=incache(gc,fd,r_offset,a_size)))
continue;
ce=alloc_cache(gc,fd,r_offset,a_size,(long long)LIO_READ);
-#ifdef _LARGEFILE64_SOURCE
@ -201,7 +208,9 @@ and the like) and other warnings.
-#endif
if(ret!=0)
{
@@ -501,81 +437,25 @@
takeoff_cache(gc,ce);
@@ -500,83 +437,27 @@ again:
out:
if(del_read) /* Wait for the first read to complete */
{
-#ifdef _LARGEFILE64_SOURCE
@ -248,15 +257,11 @@ and the like) and other warnings.
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- printf("aio_return error2: fd %d offset %lld buffer %lx size %d Opcode %d\n",
+ printf("aio_return error2: ret %zd %d\n",retval,errno);
+ printf("aio_return error2: fd %d offset %lld buffer %p size %zd Opcode %d\n",
first_ce->myaiocb.aio_fildes,
- first_ce->myaiocb.aio_fildes,
- first_ce->myaiocb.aio_offset,
- (long)(first_ce->myaiocb.aio_buf),
+ (long long)first_ce->myaiocb.aio_offset,
+ first_ce->myaiocb.aio_buf,
first_ce->myaiocb.aio_nbytes,
first_ce->myaiocb.aio_lio_opcode
- first_ce->myaiocb.aio_nbytes,
- first_ce->myaiocb.aio_lio_opcode
-#else
- printf("aio_return error2: fd %d offset %lld buffer %lx size %d Opcode %d\n",
- first_ce->myaiocb64.aio_fildes,
@ -267,11 +272,15 @@ and the like) and other warnings.
-#endif
-#else
- printf("aio_return error2: fd %d offset %d buffer %lx size %d Opcode %d\n",
- first_ce->myaiocb.aio_fildes,
+ printf("aio_return error2: ret %zd %d\n",retval,errno);
+ printf("aio_return error2: fd %d offset %lld buffer %p size %zd Opcode %d\n",
first_ce->myaiocb.aio_fildes,
- first_ce->myaiocb.aio_offset,
- (long)(first_ce->myaiocb.aio_buf),
- first_ce->myaiocb.aio_nbytes,
- first_ce->myaiocb.aio_lio_opcode
+ (long long)first_ce->myaiocb.aio_offset,
+ first_ce->myaiocb.aio_buf,
first_ce->myaiocb.aio_nbytes,
first_ce->myaiocb.aio_lio_opcode
-#endif
);
}
@ -279,23 +288,27 @@ and the like) and other warnings.
{
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
-#else
- mbcopy((char *)first_ce->myaiocb64.aio_buf,(char *)ubuffer,(size_t)retval);
-#endif
-#else
mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
- mbcopy((char *)first_ce->myaiocb.aio_buf,(char *)ubuffer,(size_t)retval);
-#endif
}
first_ce->direct=0;
@@ -602,5 +482,5 @@
takeoff_cache(gc,first_ce);
@@ -601,7 +482,7 @@ long long fd,size,op;
off64_t offset;
{
struct cache_ent *ce;
- long temp;
+ intptr_t temp;
ce=(struct cache_ent *)malloc((size_t)sizeof(struct cache_ent));
if(ce == (struct cache_ent *)0)
@@ -610,31 +490,11 @@
{
@@ -609,56 +490,22 @@ off64_t offset;
exit(175);
}
bzero(ce,sizeof(struct cache_ent));
-#ifdef _LARGEFILE64_SOURCE
@ -330,15 +343,15 @@ and the like) and other warnings.
+ if(ce->myaiocb.aio_buf == NULL)
{
printf("Malloc failed\n");
@@ -642,22 +502,8 @@
exit(176);
}
/*bzero(ce->myaiocb.aio_buf,(size_t)size);*/
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- ce->myaiocb.aio_reqprio=0;
- ce->myaiocb.aio_nbytes=(size_t)size;
- ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
- ce->myaiocb.aio_lio_opcode=(int)op;
ce->myaiocb.aio_reqprio=0;
ce->myaiocb.aio_nbytes=(size_t)size;
ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
ce->myaiocb.aio_lio_opcode=(int)op;
-#else
- ce->myaiocb64.aio_reqprio=0;
- ce->myaiocb64.aio_nbytes=(size_t)size;
@ -346,21 +359,25 @@ and the like) and other warnings.
- ce->myaiocb64.aio_lio_opcode=(int)op;
-#endif
-#else
ce->myaiocb.aio_reqprio=0;
ce->myaiocb.aio_nbytes=(size_t)size;
ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
ce->myaiocb.aio_lio_opcode=(int)op;
- ce->myaiocb.aio_reqprio=0;
- ce->myaiocb.aio_nbytes=(size_t)size;
- ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
- ce->myaiocb.aio_lio_opcode=(int)op;
-#endif
ce->fd=(int)fd;
ce->forward=0;
@@ -688,6 +534,4 @@
ce->back=gc->tail;
@@ -687,8 +534,6 @@ off64_t offset;
return(0);
}
move=gc->head;
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
while(move)
{
@@ -699,26 +543,4 @@
if((move->fd == fd) && (move->myaiocb.aio_offset==(off64_t)offset) &&
@@ -698,28 +543,6 @@ off64_t offset;
}
move=move->forward;
}
-#else
@ -387,40 +404,44 @@ and the like) and other warnings.
-#endif
return(0);
}
@@ -805,24 +627,8 @@
@@ -804,26 +627,10 @@ struct cache *gc;
ce=gc->head;
if(ce==0)
return;
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
-#else
- while((ret = aio_cancel64(0,&ce->myaiocb64))==AIO_NOTCANCELED)
-#endif
-#else
while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
- while((ret = aio_cancel(0,&ce->myaiocb))==AIO_NOTCANCELED)
-#endif
;
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- ret = aio_return(&ce->myaiocb);
ret = aio_return(&ce->myaiocb);
-#else
- ret = aio_return64(&ce->myaiocb64);
-#endif
-#else
ret = aio_return(&ce->myaiocb);
- ret = aio_return(&ce->myaiocb);
-#endif
ce->direct=0;
takeoff_cache(gc,ce); /* remove from cache */
@@ -865,98 +671,27 @@
}
@@ -864,100 +671,29 @@ long long depth;
*/
if((ce=(struct cache_ent *)incache(gc,fd,offset,size)))
{
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
-#else
- while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
- {
@ -428,10 +449,10 @@ and the like) and other warnings.
- }
-#endif
-#else
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
-#endif
if(ret)
- printf("aio_error 3: ret %d %d\n",ret,errno);
@ -518,7 +539,9 @@ and the like) and other warnings.
-#endif
);
}
@@ -974,22 +709,8 @@
ce->direct=1;
@@ -973,30 +709,16 @@ long long depth;
first_ce=alloc_cache(gc,fd,offset,size,(long long)LIO_READ); /* allocate buffer */
/*printf("allocated buffer/read %x offset %d\n",first_ce->myaiocb.aio_buf,offset);*/
again:
-#ifdef _LARGEFILE64_SOURCE
@ -541,22 +564,24 @@ and the like) and other warnings.
-#endif
if(ret!=0)
{
@@ -997,5 +718,5 @@
if(errno==EAGAIN)
goto again;
else
- printf("error returned from aio_read(). Ret %d errno %d\n",ret,errno);
+ printf("error returned from aio_read(). Ret %zd errno %d\n",ret,errno);
}
}
@@ -1022,22 +743,8 @@
if(stride==0) /* User does not want read-ahead */
@@ -1021,24 +743,10 @@ again:
if((ce=incache(gc,fd,r_offset,a_size)))
continue;
ce=alloc_cache(gc,fd,r_offset,a_size,(long long)LIO_READ);
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- ce->oldbuf=ce->myaiocb.aio_buf;
- ce->oldfd=ce->myaiocb.aio_fildes;
- ce->oldsize=ce->myaiocb.aio_nbytes;
- ret=aio_read(&ce->myaiocb);
ce->oldbuf=ce->myaiocb.aio_buf;
ce->oldfd=ce->myaiocb.aio_fildes;
ce->oldsize=ce->myaiocb.aio_nbytes;
ret=aio_read(&ce->myaiocb);
-#else
- ce->oldbuf=ce->myaiocb64.aio_buf;
- ce->oldfd=ce->myaiocb64.aio_fildes;
@ -564,14 +589,16 @@ and the like) and other warnings.
- ret=aio_read64(&ce->myaiocb64);
-#endif
-#else
ce->oldbuf=ce->myaiocb.aio_buf;
ce->oldfd=ce->myaiocb.aio_fildes;
ce->oldsize=ce->myaiocb.aio_nbytes;
ret=aio_read(&ce->myaiocb);
- ce->oldbuf=ce->myaiocb.aio_buf;
- ce->oldfd=ce->myaiocb.aio_fildes;
- ce->oldsize=ce->myaiocb.aio_nbytes;
- ret=aio_read(&ce->myaiocb);
-#endif
if(ret!=0)
{
@@ -1049,39 +756,10 @@
takeoff_cache(gc,ce);
@@ -1048,97 +756,33 @@ again:
out:
if(del_read) /* Wait for the first read to complete */
{
-#ifdef _LARGEFILE64_SOURCE
@ -612,18 +639,18 @@ and the like) and other warnings.
+ printf("aio_error 4: ret %zd %d\n",ret,errno);
if(first_ce->oldbuf != first_ce->myaiocb.aio_buf ||
first_ce->oldfd != first_ce->myaiocb.aio_fildes ||
@@ -1089,55 +767,20 @@
first_ce->oldsize != first_ce->myaiocb.aio_nbytes)
printf("It changed in flight2\n");
retval=aio_return(&first_ce->myaiocb);
-#endif
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- if(retval < first_ce->myaiocb.aio_nbytes)
if(retval < first_ce->myaiocb.aio_nbytes)
-#else
- if(retval < first_ce->myaiocb64.aio_nbytes)
-#endif
-#else
if(retval < first_ce->myaiocb.aio_nbytes)
- if(retval < first_ce->myaiocb.aio_nbytes)
-#endif
{
- printf("aio_return error5: ret %d %d\n",retval,errno);
@ -674,7 +701,9 @@ and the like) and other warnings.
+ *ubuffer= NULL;
first_ce->direct=1; /* do not delete the buffer */
takeoff_cache(gc,first_ce);
@@ -1218,30 +861,14 @@
putoninuse(gc,first_ce);
@@ -1217,32 +861,16 @@ long long depth;
size_t ret;
ce=allocate_write_buffer(gc,fd,offset,size,(long long)LIO_WRITE,depth,0LL,(char *)0,(char *)0);
ce->direct=0; /* not direct. Lib supplies buffer and must free it */
-#ifdef _LARGEFILE64_SOURCE
@ -708,7 +737,9 @@ and the like) and other warnings.
-#endif
if(ret==-1)
{
@@ -1259,11 +886,11 @@
if(errno==EAGAIN)
@@ -1258,13 +886,13 @@ again:
}
else
{
- printf("Error in aio_write: ret %d errno %d count %lld\n",ret,errno,gc->w_count);
@ -726,14 +757,18 @@ and the like) and other warnings.
+ ce->myaiocb.aio_nbytes);
*/
exit(177);
@@ -1289,5 +916,5 @@
}
@@ -1288,7 +916,7 @@ long long direct;
char *buffer,*free_addr;
{
struct cache_ent *ce;
- long temp;
+ intptr_t temp;
if(fd==0LL)
{
@@ -1304,44 +931,10 @@
printf("Setting up write buffer insane\n");
@@ -1303,46 +931,12 @@ char *buffer,*free_addr;
exit(179);
}
bzero(ce,sizeof(struct cache_ent));
-#ifdef _LARGEFILE64_SOURCE
@ -780,7 +815,9 @@ and the like) and other warnings.
+ temp = (intptr_t)ce->real_address;
temp = (temp+page_size) & ~(page_size-1);
ce->myaiocb.aio_buf=(volatile void *)temp;
@@ -1353,27 +946,12 @@
}
@@ -1352,29 +946,14 @@ char *buffer,*free_addr;
ce->real_address=(char *)free_addr;
}
if(ce->myaiocb.aio_buf == 0)
-#endif
@ -790,10 +827,10 @@ and the like) and other warnings.
}
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- ce->myaiocb.aio_reqprio=0;
- ce->myaiocb.aio_nbytes=(size_t)size;
- ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
- ce->myaiocb.aio_lio_opcode=(int)op;
ce->myaiocb.aio_reqprio=0;
ce->myaiocb.aio_nbytes=(size_t)size;
ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
ce->myaiocb.aio_lio_opcode=(int)op;
-#else
- ce->myaiocb64.aio_reqprio=0;
- ce->myaiocb64.aio_nbytes=(size_t)size;
@ -801,21 +838,25 @@ and the like) and other warnings.
- ce->myaiocb64.aio_lio_opcode=(int)op;
-#endif
-#else
ce->myaiocb.aio_reqprio=0;
ce->myaiocb.aio_nbytes=(size_t)size;
ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
ce->myaiocb.aio_lio_opcode=(int)op;
- ce->myaiocb.aio_reqprio=0;
- ce->myaiocb.aio_nbytes=(size_t)size;
- ce->myaiocb.aio_sigevent.sigev_notify=SIGEV_NONE;
- ce->myaiocb.aio_lio_opcode=(int)op;
-#endif
ce->fd=(int)fd;
return(ce);
@@ -1409,5 +987,5 @@
}
@@ -1408,7 +987,7 @@ struct cache *gc;
{
while(gc->w_head)
{
- /*printf("async_write_finish: Waiting for buffer %x to finish\n",gc->w_head->myaiocb64.aio_buf);*/
+ /*printf("async_write_finish: Waiting for buffer %x to finish\n",gc->w_head->myaiocb.aio_buf);*/
async_wait_for_write(gc);
}
@@ -1423,5 +1001,6 @@
}
@@ -1422,7 +1001,8 @@ async_wait_for_write(gc)
struct cache *gc;
{
struct cache_ent *ce;
- size_t ret,retval;
@ -823,7 +864,9 @@ and the like) and other warnings.
+ int retval;
if(gc->w_head==0)
return;
@@ -1432,67 +1011,26 @@
ce=gc->w_head;
@@ -1431,69 +1011,28 @@ struct cache *gc;
ce->forward=0;
if(ce==gc->w_tail)
gc->w_tail=0;
- /*printf("Wait for buffer %x offset %lld size %d to finish\n",
@ -838,10 +881,10 @@ and the like) and other warnings.
*/
-#ifdef _LARGEFILE64_SOURCE
-#ifdef __LP64__
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
-#else
- while((ret=aio_error64(&ce->myaiocb64))== EINPROGRESS)
- {
@ -849,10 +892,10 @@ and the like) and other warnings.
- }
-#endif
-#else
while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
{
async_suspend(ce);
}
- while((ret=aio_error(&ce->myaiocb))== EINPROGRESS)
- {
- async_suspend(ce);
- }
-#endif
if(ret)
{
@ -899,7 +942,9 @@ and the like) and other warnings.
+ if(retval < 0)
{
printf("aio_return error: %d\n",errno);
@@ -1534,19 +1072,11 @@
}
@@ -1533,21 +1072,13 @@ char *free_addr;
ce->direct=0; /* have library de-allocate the buffer */
async_put_on_write_queue(gc,ce);
/*
- printf("awnc: fd %d offset %lld, size %d\n",ce->myaiocb64.aio_fildes,
@ -922,7 +967,9 @@ and the like) and other warnings.
-#endif
if(ret==-1)
{
@@ -1564,26 +1094,10 @@
if(errno==EAGAIN)
@@ -1563,28 +1094,12 @@ again:
}
else
{
- printf("Error in aio_write: ret %d errno %d\n",ret,errno);
@ -953,7 +1000,9 @@ and the like) and other warnings.
-#endif
exit(182);
}
@@ -1596,5 +1110,6 @@
}
@@ -1595,7 +1110,8 @@ again:
}
void mbcopy(source, dest, len)
-char *source,*dest;
@ -961,3 +1010,4 @@ and the like) and other warnings.
+char *dest;
size_t len;
{
int i;

View File

@ -1,12 +1,15 @@
--- pit_server.c 2015-10-20 14:12:13.000000000 +0000
--- pit_server.c.orig 2015-10-20 14:12:13 UTC
+++ pit_server.c
@@ -171,5 +171,4 @@
@@ -170,7 +170,6 @@ int main( int argc,
if(need < 1)
{
USAGE;
- exit;
}
/*
@@ -311,6 +310,6 @@
** Open both a TCP and UDP socket, for both IPv4 & IPv6, on which to receive
@@ -310,8 +309,8 @@ static int openSckt( const char *service
" ai_family = %d (PF_INET = %d, PF_INET6 = %d)\n"
" ai_socktype = %d (SOCK_STREAM = %d, SOCK_DGRAM = %d)\n"
" ai_protocol = %d (IPPROTO_TCP = %d, IPPROTO_UDP = %d)\n"
- " ai_addrlen = %d (sockaddr_in = %lu, "
@ -15,7 +18,9 @@
+ "sockaddr_in6 = %zu)\n",
ai->ai_flags,
ai->ai_family,
@@ -621,6 +620,6 @@
PF_INET,
@@ -620,8 +619,8 @@ static void pit( int tSckt[ ],
fprintf( stderr,
"Sockaddr info for new TCP client:\n"
" sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
- " addr len = %d (sockaddr_in = %lu, "
@ -24,14 +29,18 @@
+ "sockaddr_in6 = %zu)\n",
sadr->sa_family,
AF_INET,
@@ -729,5 +728,5 @@
AF_INET6,
@@ -728,7 +727,7 @@ static void pit( int tSckt[ ],
{
ssize_t rBytes = count;
fprintf( stderr,
- "%s: UDP datagram received (%ld bytes).\n",
+ "%s: UDP datagram received (%zd bytes).\n",
pgmName,
count );
@@ -746,6 +745,6 @@
while ( count > 0 )
@@ -745,8 +744,8 @@ static void pit( int tSckt[ ],
fprintf( stderr,
"Remote client's sockaddr info:\n"
" sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
- " addr len = %d (sockaddr_in = %lu, "
@ -40,3 +49,4 @@
+ "sockaddr_in6 = %zu)\n",
sadr->sa_family,
AF_INET,
AF_INET6,