Date: Fri, 2 Jun 2017 12:50:01 +0000 From: Glen Barber <gjb@FreeBSD.org> To: Ngie Cooper <ngie@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r319173 - stable/11/tests/sys/aio Message-ID: <20170602125001.GA44390@FreeBSD.org> In-Reply-To: <201705300309.v4U3911t053281@repo.freebsd.org> References: <201705300309.v4U3911t053281@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Tue, May 30, 2017 at 03:09:01AM +0000, Ngie Cooper wrote: > Author: ngie > Date: Tue May 30 03:09:01 2017 > New Revision: 319173 > URL: https://svnweb.freebsd.org/changeset/base/319173 > > Log: > MFC r312913,r318100,r318107: > > r312913 (by asomers): > > Improve the aio tests > > * Add tests for aio_suspend(2). > * Add tests for polled completion notification. > * Test the full matrix of file descriptor types and completion notification > mechanisms. > * Don't bother with mkstemp, because ATF runs every test in its own temp dir. > * Fix some typos. > * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls. > > r318100: > > style(9): move function definition curly braces to column 0 > > r318107: > > Remove unused constant (PATH_TEMPLATE) > > It was made unnecessary in r312913. > > MFC with: r312913 > > Modified: > stable/11/tests/sys/aio/aio_test.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/tests/sys/aio/aio_test.c > ============================================================================== > --- stable/11/tests/sys/aio/aio_test.c Tue May 30 03:05:22 2017 (r319172) > +++ stable/11/tests/sys/aio/aio_test.c Tue May 30 03:09:01 2017 (r319173) > @@ -33,7 +33,7 @@ > * reading it from a second descriptor using AIO. For some targets, the same > * fd is used for write and read (i.e., file, md device), but for others the > * operation is performed on a peer (pty, socket, fifo, etc). A timeout is > - * initiated to detect undo blocking. This test does not attempt to exercise > + * initiated to detect undue blocking. This test does not attempt to exercise > * error cases or more subtle asynchronous behavior, just make sure that the > * basic operations work on some basic object types. > */ > @@ -63,8 +63,6 @@ > #include "freebsd_test_suite/macros.h" > #include "local.h" > > -#define PATH_TEMPLATE "aio.XXXXXXXXXX" > - > /* > * GLOBAL_MAX sets the largest usable buffer size to be read and written, as > * it sizes ac_buffer in the aio_context structure. It is also the default > @@ -74,6 +72,13 @@ > #define GLOBAL_MAX 16384 > > #define BUFFER_MAX GLOBAL_MAX > + > +/* > + * A completion function will block until the aio has completed, then return > + * the result of the aio. errno will be set appropriately. > + */ > +typedef ssize_t (*completion)(struct aiocb*); > + > struct aio_context { > int ac_read_fd, ac_write_fd; > long ac_seed; > @@ -179,6 +184,48 @@ aio_context_init(struct aio_context *ac, int read_fd, > ac->ac_cleanup_arg = cleanup_arg; > } > > +static ssize_t > +poll(struct aiocb *aio) > +{ > + int err; > + > + while ((err = aio_error(aio)) == EINPROGRESS && !aio_timedout) > + usleep(25000); > + switch (err) { > + case EINPROGRESS: > + errno = EINTR; > + return (-1); > + case 0: > + return (aio_return(aio)); > + default: > + return (err); > + } > +} > + This appears to have broken GCC builds. ===> tests/sys/aio (all) cc1: warnings being treated as errors /usr/src/tests/sys/aio/aio_test.c: In function 'poll': /usr/src/tests/sys/aio/aio_test.c:190: warning: declaration of 'err' shadows a global declaration /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadowed declaration is here /usr/src/tests/sys/aio/aio_test.c: In function 'suspend': /usr/src/tests/sys/aio/aio_test.c:209: warning: declaration of 'err' shadows a global declaration /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadowed declaration is here Glen [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlkxXvMACgkQAxRYpUeP 4pO9rw/+IknAruVUyAsqj8eAL0fR/jqSeZIVNZOmzdRbAelf2nQmNylISRgeh7zC D60HHbjIM8aMCoOCI1wbk5wvaANIcpURXfLXa0Mdo98qScCABhvLrVLz6gYDXSQh qwYx4Qiz4hpKgbcUw47iomMOneJ13m70QYNNXSUD/xnsWXEZJ9ebCtoshGQHBzDg wiT9rPwRLiyk5nOJtPnbbxV3Qap4MCax0/BSO9AFYQRufrCfXroNANOdggnR7Pd/ 01cfEfYVZX5crx5RZ+HajUHXjsIg1Pz6E5Sqsd8ozD8ColX1Vn7y3HBvm+CJnpm4 jxBBxeXiQoy+VzbdAgUpSFN2XSYuNuPdVhFPoY6Ibxyc3cWVUC0ansEiEpqJLF6H iBjHhGXJ/KIErOwcj/lUlbnGnmUd46rCk16Pa2wS8biv67bsFdzKOXII4v3nqC8r qO9TthRnnNcb/4tOsLrynBICaertj70h/Gx92fmidAsBoIP7y1G8UEap7wqwLPSl kG8wSkdS+9BL048zBOI2kN87vrz5VtjvAvl6vODaHlUuk9Bx0vuHQBLbystxWTrq 3dN78VdRGKg8/wIAnHVHxAQ5RQGOgYVvvvqDcqIaA1lbzNiqqbVa+DRz07+NROk0 z1U3pfuGKsI59He0Pm0PchU1iVyU1lIROH8fxDDbOFNriqaEsu0= =B09r -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170602125001.GA44390>
