Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Oct 2006 12:31:31 +0400
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Tom Rhodes <trhodes@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/sys aio_return.2
Message-ID:  <20061007083131.GA82415@rambler-co.ru>
In-Reply-To: <200610070534.k975Yq52033812@repoman.freebsd.org>
References:  <200610070534.k975Yq52033812@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Tom,

On Sat, Oct 07, 2006 at 05:34:51AM +0000, Tom Rhodes wrote:
> trhodes     2006-10-07 05:34:51 UTC
>=20
>   FreeBSD src repository
>=20
>   Modified files:
>     lib/libc/sys         aio_return.2=20
>   Log:
>   Fix ambiguity in description.  Note that the aio_return() system call s=
hould
>   only be called once after failure or completion of an AIO request.  Bum=
p doc
>   date while I'm here.
>  =20
>   Noticed by:     Samy Al Bahra
>  =20
>   Revision  Changes    Path
>   1.18      +9 -5      src/lib/libc/sys/aio_return.2
>=20
To me, what's now is more confusing than what it was, see below.

: The
: .Fn aio_return
: system call
: should only be called once, to obtain the final status of an asynchronous
: I/O operation once
: .Xr aio_error 2
: returns something other than
: .Er EINPROGRESS .

What was there was technically correct and unambiguous: once the
request has completed (which can be determined by aio_error()
returning !EINPROGRESS), either successfully or unsuccessfully,
the aio_return() may be called, only once, to return a status
of an operation (return value and errno if return value =3D=3D -1).

Now,

: The
: .Fn aio_return
: system call
: should only be called once, to obtain the final status of an asynchronous
: I/O operation.
: If the error status of the request is
: .Er EINPROGRESS ,
: an undefined value is returned.
: The
: .Fn aio_return
: function should only be called on completion or failure of an
: AIO request.

it is more confusing.  You removed the description of how you
can determine when it's safe to call aio_return() (when the
operation has completed):

If an operation is still in progress, and you call aio_return(),
the results are undefined, both for an operation and this function.
Both POSIX standard and our manpage (both old and new versions)
say that calling it again is prohibited.  So before calling
aio_return() you need to make sure that the call has completed.

"If the error status of the request is EINPROGRESS, an undefined
value is returned."  This is very confusing while correct for a
standard.

I think this is a deficiency in the standard; I'd expect that
for in-progress operations, aio_return() returned -1 and set
errno =3D=3D EINPROGRESS, and allowed to be called again.


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--Nq2Wo0NMKNjxTN9z
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFJ2XjqRfpzJluFF4RAt+LAKCRGxb79eVrcMMop0EfHpCjp5hBgACfXM9G
pv1MySlvGT5RaucOy7brQmc=
=cVvT
-----END PGP SIGNATURE-----

--Nq2Wo0NMKNjxTN9z--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061007083131.GA82415>