From owner-svn-src-stable@FreeBSD.ORG Fri May 15 22:13:12 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D71E266F; Fri, 15 May 2015 22:13:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B901F1B55; Fri, 15 May 2015 22:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4FMDCZF017334; Fri, 15 May 2015 22:13:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4FMDBA4017329; Fri, 15 May 2015 22:13:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201505152213.t4FMDBA4017329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 15 May 2015 22:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282992 - in stable/9/tools/regression/aio/kqueue: . lio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2015 22:13:13 -0000 Author: ngie Date: Fri May 15 22:13:11 2015 New Revision: 282992 URL: https://svnweb.freebsd.org/changeset/base/282992 Log: MFC r280893,r280894,r280895: r280893: Cleanup and do minor refactoring before converting testcases to ATF - Convert errx(-1, ..) to errx(1, ..) - Move the aio(4) checks to a single function (aio_available); use modfind(2) instead of depending on SIGSYS (doesn't work when aio(4) support is missing, not documented in the aio syscall manpages). - Use aio_available liberally in the testcase functions - Use mkstemp(3) + unlink(2) instead of mktemp(3) - Fix some -Wunused warnings - Bump WARNS to 6 Submitted by: mjohnston [*] Sponsored by: EMC / Isilon Storage Division r280894: Minor cleanup before converting to ATF testcases - Remove blank (tab-only) lines. - Fix -Wunused warnings. - Bump up to WARNS= 6 r280895: - Fix -Wsign issue - Bump up to WARNS=6 Modified: stable/9/tools/regression/aio/kqueue/Makefile stable/9/tools/regression/aio/kqueue/aio_kqueue.c stable/9/tools/regression/aio/kqueue/lio/Makefile stable/9/tools/regression/aio/kqueue/lio/lio_kqueue.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) stable/9/tools/regression/aio/aiotest/ (props changed) Modified: stable/9/tools/regression/aio/kqueue/Makefile ============================================================================== --- stable/9/tools/regression/aio/kqueue/Makefile Fri May 15 21:33:19 2015 (r282991) +++ stable/9/tools/regression/aio/kqueue/Makefile Fri May 15 22:13:11 2015 (r282992) @@ -3,4 +3,8 @@ PROG= aio_kqueue NO_MAN= +WARNS?= 6 + +SUBDIR+= lio + .include Modified: stable/9/tools/regression/aio/kqueue/aio_kqueue.c ============================================================================== --- stable/9/tools/regression/aio/kqueue/aio_kqueue.c Fri May 15 21:33:19 2015 (r282991) +++ stable/9/tools/regression/aio/kqueue/aio_kqueue.c Fri May 15 22:13:11 2015 (r282992) @@ -177,7 +177,7 @@ main (int argc, char *argv[]) #endif if (result != sizeof(buffer)) { printf("FAIL: run %d, operation %d, result %d " - " (errno=%d) should be %d\n", run, pending, + " (errno=%d) should be %zu\n", run, pending, result, errno, sizeof(buffer)); failed++; } else Modified: stable/9/tools/regression/aio/kqueue/lio/Makefile ============================================================================== --- stable/9/tools/regression/aio/kqueue/lio/Makefile Fri May 15 21:33:19 2015 (r282991) +++ stable/9/tools/regression/aio/kqueue/lio/Makefile Fri May 15 22:13:11 2015 (r282992) @@ -3,4 +3,6 @@ PROG= lio_kqueue NO_MAN= +WARNS?= 6 + .include Modified: stable/9/tools/regression/aio/kqueue/lio/lio_kqueue.c ============================================================================== --- stable/9/tools/regression/aio/kqueue/lio/lio_kqueue.c Fri May 15 21:33:19 2015 (r282991) +++ stable/9/tools/regression/aio/kqueue/lio/lio_kqueue.c Fri May 15 22:13:11 2015 (r282992) @@ -37,13 +37,15 @@ * http://www.ambrisko.com/doug/listio_kqueue/listio_kqueue.patch */ -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include +#include +#include #include #define PATH_TEMPLATE "/tmp/aio.XXXXXXXXXX" @@ -52,9 +54,10 @@ #define MAX LIO_MAX * 16 #define MAX_RUNS 300 +int main(int argc, char *argv[]){ int fd; - struct aiocb *iocb[MAX], *kq_iocb; + struct aiocb *iocb[MAX]; struct aiocb **lio[LIO_MAX], **lio_element, **kq_lio; int i, result, run, error, j, k; char buffer[32768]; @@ -65,7 +68,7 @@ main(int argc, char *argv[]){ time_t time1, time2; char *file, pathname[sizeof(PATH_TEMPLATE)-1]; int tmp_file = 0, failed = 0; - + if (kq < 0) { perror("No kqeueue\n"); exit(1); @@ -89,7 +92,7 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("Hello kq %d fd %d\n", kq, fd); #endif - + for (run = 0; run < MAX_RUNS; run++){ #ifdef DEBUG printf("Run %d\n", run); @@ -137,13 +140,13 @@ main(int argc, char *argv[]){ printf("write %d is at %p\n", j, lio[j]); #endif } - + for(i = 0; i < LIO_MAX; i++) { for(j = LIO_MAX - 1; j >=0; j--) { if (lio[j]) break; } - + for(;;) { bzero(&ke, sizeof(ke)); bzero(&kq_returned, sizeof(ke)); @@ -169,18 +172,18 @@ main(int argc, char *argv[]){ kq_returned.udata, lio[j]); #endif - + if(kq_lio) break; #ifdef DEBUG printf("Try again\n"); #endif - } - + } + #ifdef DEBUG printf("lio %p\n", lio); #endif - + for (j = 0; j < LIO_MAX; j++) { if (lio[j] == kq_lio) { break; @@ -201,12 +204,12 @@ main(int argc, char *argv[]){ printf("PASS: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); } for(k = 0; k < MAX / LIO_MAX; k++){ - result = aio_return(kq_lio[k]); + result = aio_return(kq_lio[k]); #ifdef DEBUG printf("Return Resulto for %d %d is %d\n", j, k, result); #endif if (result != sizeof(buffer)) { - printf("FAIL: run %d, operation %d sub-opt %d result %d (errno=%d) should be %d\n", + printf("FAIL: run %d, operation %d sub-opt %d result %d (errno=%d) should be %zu\n", run, LIO_MAX - i -1, k, result, errno, sizeof(buffer)); } else { printf("PASS: run %d, operation %d sub-opt %d result %d\n", @@ -216,13 +219,13 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("\n"); #endif - + for(k = 0; k < MAX / LIO_MAX; k++) { free(lio[j][k]); } free(lio[j]); lio[j] = NULL; - } + } } #ifdef DEBUG printf("Done\n");